Re: [PATCHv2 6/6] usb: dwc3: host: convey the PHYs to xhci

2014-06-19 Thread Felipe Balbi
On Thu, Jun 05, 2014 at 03:52:58PM +0300, Heikki Krogerus wrote:
 On some platforms a PHY may need to be handled also in the
 host controller driver. Exynos5420 SoC requires some PHY
 tuning based on the USB speed. This patch delivers dwc3's
 PHYs to the xhci platform device when it's created.
 
 Signed-off-by: Heikki Krogerus heikki.kroge...@linux.intel.com
 Cc: Felipe Balbi ba...@ti.com

if the rest of the series gets applied, I'm fine with this change

Acked-by: Felipe Balbi ba...@ti.com

-- 
balbi


signature.asc
Description: Digital signature


[PATCHv2 6/6] usb: dwc3: host: convey the PHYs to xhci

2014-06-05 Thread Heikki Krogerus
On some platforms a PHY may need to be handled also in the
host controller driver. Exynos5420 SoC requires some PHY
tuning based on the USB speed. This patch delivers dwc3's
PHYs to the xhci platform device when it's created.

Signed-off-by: Heikki Krogerus heikki.kroge...@linux.intel.com
Cc: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/host.c | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 32db328..8387564 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -27,8 +27,7 @@ int dwc3_host_init(struct dwc3 *dwc)
xhci = platform_device_alloc(xhci-hcd, PLATFORM_DEVID_AUTO);
if (!xhci) {
dev_err(dwc-dev, couldn't allocate xHCI device\n);
-   ret = -ENOMEM;
-   goto err0;
+   return -ENOMEM;
}
 
dma_set_coherent_mask(xhci-dev, dwc-dev-coherent_dma_mask);
@@ -46,22 +45,33 @@ int dwc3_host_init(struct dwc3 *dwc)
goto err1;
}
 
+   phy_create_lookup(dwc-usb2_generic_phy, usb2-phy,
+ dev_name(xhci-dev));
+   phy_create_lookup(dwc-usb3_generic_phy, usb3-phy,
+ dev_name(xhci-dev));
+
ret = platform_device_add(xhci);
if (ret) {
dev_err(dwc-dev, failed to register xHCI device\n);
-   goto err1;
+   goto err2;
}
 
return 0;
-
+err2:
+   phy_remove_lookup(dwc-usb2_generic_phy, usb2-phy,
+ dev_name(xhci-dev));
+   phy_remove_lookup(dwc-usb3_generic_phy, usb3-phy,
+ dev_name(xhci-dev));
 err1:
platform_device_put(xhci);
-
-err0:
return ret;
 }
 
 void dwc3_host_exit(struct dwc3 *dwc)
 {
+   phy_remove_lookup(dwc-usb2_generic_phy, usb2-phy,
+ dev_name(dwc-xhci-dev));
+   phy_remove_lookup(dwc-usb3_generic_phy, usb3-phy,
+ dev_name(dwc-xhci-dev));
platform_device_unregister(dwc-xhci);
 }
-- 
2.0.0.rc4

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html