summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorVignesh R <vigneshr@ti.com>2018-03-07 14:50:08 +0530
committerMarek Vasut <marex@denx.de>2018-03-17 03:19:08 +0100
commit7d4e4d30631ba9350a18ab2243e749d583b402ab (patch)
tree737ff1a19e00fc059ab66935c7ef8296ce2592bd /drivers/usb/host
parent42637fdae833f8c3e8a0270ea7e74152cbd8ef38 (diff)
usb: xhci-dwc3: Power on USB PHY before using
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>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-dwc3.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index 258d1cd00a..cf1986bebd 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);