提交 08f871a3 编写于 作者: H Heikki Krogerus 提交者: Kishon Vijay Abraham I

usb: dwc3: host: convey the PHYs to xhci

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: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: NVivek Gautam <gautam.vivek@samsung.com>
Acked-by: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
上级 dbc98635
...@@ -29,8 +29,7 @@ int dwc3_host_init(struct dwc3 *dwc) ...@@ -29,8 +29,7 @@ int dwc3_host_init(struct dwc3 *dwc)
xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO); xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO);
if (!xhci) { if (!xhci) {
dev_err(dwc->dev, "couldn't allocate xHCI device\n"); dev_err(dwc->dev, "couldn't allocate xHCI device\n");
ret = -ENOMEM; return -ENOMEM;
goto err0;
} }
dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask); dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);
...@@ -60,22 +59,33 @@ int dwc3_host_init(struct dwc3 *dwc) ...@@ -60,22 +59,33 @@ int dwc3_host_init(struct dwc3 *dwc)
goto err1; 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); ret = platform_device_add(xhci);
if (ret) { if (ret) {
dev_err(dwc->dev, "failed to register xHCI device\n"); dev_err(dwc->dev, "failed to register xHCI device\n");
goto err1; goto err2;
} }
return 0; 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: err1:
platform_device_put(xhci); platform_device_put(xhci);
err0:
return ret; return ret;
} }
void dwc3_host_exit(struct dwc3 *dwc) 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); platform_device_unregister(dwc->xhci);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册