From: Vignesh R <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] usb: xhci-dwc3: Power on USB PHY before using
Date: Wed, 7 Mar 2018 14:50:08 +0530 [thread overview]
Message-ID: <20180307092010.7091-2-vigneshr@ti.com> (raw)
In-Reply-To: <20180307092010.7091-1-vigneshr@ti.com>
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 <vigneshr@ti.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
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);
--
2.16.2
next prev parent reply other threads:[~2018-03-07 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 9:20 [U-Boot] [PATCH v2 0/3] xhci-dwc3: Couple of fixes for USB3 support Vignesh R
2018-03-07 9:20 ` Vignesh R [this message]
2018-03-17 2:19 ` [U-Boot] [PATCH v2 1/3] usb: xhci-dwc3: Power on USB PHY before using Marek Vasut
2018-03-07 9:20 ` [U-Boot] [PATCH v2 2/3] usb: xhci-dwc3: Refractor PHY operations into separate function Vignesh R
2018-03-08 4:14 ` Bin Meng
2018-03-07 9:20 ` [U-Boot] [PATCH v2 3/3] ubs: xhci-dwc3: Enable USB3 PHY when available Vignesh R
2018-03-08 4:14 ` Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180307092010.7091-2-vigneshr@ti.com \
--to=vigneshr@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox