From patchwork Wed Mar 7 09:20:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Raghavendra, Vignesh" X-Patchwork-Id: 882487 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="BlxS8ako"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zx7QW03v4z9sf8 for ; Wed, 7 Mar 2018 20:20:01 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 0C2E2C21F27; Wed, 7 Mar 2018 09:19:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EDBC2C21C2F; Wed, 7 Mar 2018 09:19:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 25893C21C2C; Wed, 7 Mar 2018 09:19:52 +0000 (UTC) Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by lists.denx.de (Postfix) with ESMTPS id 600EFC21C2F for ; Wed, 7 Mar 2018 09:19:51 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w279JkeB010109; Wed, 7 Mar 2018 03:19:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520414386; bh=QpQFhF1Ual1P+AFnFIXZe1knRQsjyJcws+NmHF2oO5A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BlxS8ako65q+opTHmMp1UFvBR5vrRHlyiXVbgXSeoKICdH4qMXwnP1HZyj1tiSmPR CDWcEJb2Fo7wSQKrtKhnI7RcZ5Xu+ubeGF5170aOXhZH/yWuBTnCOQoPiAJ79rWXD6 7VBscFNRdqz7z6JfI9ob6mBLU/w/SJf8iJdKoIHg= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w279JkI1012126; Wed, 7 Mar 2018 03:19:46 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 03:19:46 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 03:19:46 -0600 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w279JfDZ012989; Wed, 7 Mar 2018 03:19:44 -0600 From: Vignesh R To: Bin Meng , Marek Vasut Date: Wed, 7 Mar 2018 14:50:08 +0530 Message-ID: <20180307092010.7091-2-vigneshr@ti.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307092010.7091-1-vigneshr@ti.com> References: <20180307092010.7091-1-vigneshr@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 1/3] usb: xhci-dwc3: Power on USB PHY before using X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" It is wrong that expect .phy_init() to also power on the PHY. Therefore, explicitly, call generic_phy_power_on() after generic_phy_power_init() in order to power on PHY before using it. Signed-off-by: Vignesh R Reviewed-by: Bin Meng --- drivers/usb/host/xhci-dwc3.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index 258d1cd00a08..cf1986bebd07 100644 --- a/drivers/usb/host/xhci-dwc3.c +++ b/drivers/usb/host/xhci-dwc3.c @@ -137,6 +137,12 @@ static int xhci_dwc3_probe(struct udevice *dev) pr_err("Can't init USB PHY for %s\n", dev->name); return ret; } + + ret = generic_phy_power_on(&plat->usb_phy); + if (ret) { + pr_err("Can't power on USB PHY for %s\n", dev->name); + return ret; + } } dwc3_reg = (struct dwc3 *)((char *)(hccr) + DWC3_REG_OFFSET); @@ -159,6 +165,12 @@ static int xhci_dwc3_remove(struct udevice *dev) int ret; if (generic_phy_valid(&plat->usb_phy)) { + ret = generic_phy_power_off(&plat->usb_phy); + if (ret) { + pr_err("Can't poweroff USB PHY for %s\n", dev->name); + return ret; + } + ret = generic_phy_exit(&plat->usb_phy); if (ret) { pr_err("Can't deinit USB PHY for %s\n", dev->name);