Re: [U-Boot] [PATCH v2 1/3] usb: xhci-dwc3: Power on USB PHY before using

2018-03-16 Thread Marek Vasut
On 03/07/2018 10:20 AM, Vignesh R wrote:
> 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 

Applied all three, thanks

> ---
>  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(>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(>usb_phy)) {
> + ret = generic_phy_power_off(>usb_phy);
> + if (ret) {
> + pr_err("Can't poweroff USB PHY for %s\n", dev->name);
> + return ret;
> + }
> +
>   ret = generic_phy_exit(>usb_phy);
>   if (ret) {
>   pr_err("Can't deinit USB PHY for %s\n", dev->name);
> 


-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 1/3] usb: xhci-dwc3: Power on USB PHY before using

2018-03-07 Thread Vignesh R
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(>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(>usb_phy)) {
+   ret = generic_phy_power_off(>usb_phy);
+   if (ret) {
+   pr_err("Can't poweroff USB PHY for %s\n", dev->name);
+   return ret;
+   }
+
ret = generic_phy_exit(>usb_phy);
if (ret) {
pr_err("Can't deinit USB PHY for %s\n", dev->name);
-- 
2.16.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot