summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-12-18 12:02:04 +0100
committerFelipe Balbi <balbi@ti.com>2015-12-22 12:05:44 -0600
commit39cee200c23eb3e28056011a1dec053beba4a18a (patch)
tree6eb9b627cebe872da265c05c0d01785e5df3a22d /drivers/usb
parent8a0859b65b06ea07461271ce4f1fe25b48d1ec55 (diff)
usb: musb: core: call init and shutdown for the usb phy
The phy's init routine must be called before it can be used. Do so in musb_init_controller and the matching shutdown in musb_remove. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/musb_core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 04548423094b..c3791a01ab31 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2136,6 +2136,10 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
pm_runtime_get_sync(musb->controller);
+ status = usb_phy_init(musb->xceiv);
+ if (status < 0)
+ goto err_usb_phy_init;
+
if (use_dma && dev->dma_mask) {
musb->dma_controller =
musb_dma_controller_create(musb, musb->mregs);
@@ -2256,7 +2260,11 @@ fail3:
cancel_delayed_work_sync(&musb->deassert_reset_work);
if (musb->dma_controller)
musb_dma_controller_destroy(musb->dma_controller);
+
fail2_5:
+ usb_phy_shutdown(musb->xceiv);
+
+err_usb_phy_init:
pm_runtime_put_sync(musb->controller);
fail2:
@@ -2317,6 +2325,8 @@ static int musb_remove(struct platform_device *pdev)
if (musb->dma_controller)
musb_dma_controller_destroy(musb->dma_controller);
+ usb_phy_shutdown(musb->xceiv);
+
cancel_work_sync(&musb->irq_work);
cancel_delayed_work_sync(&musb->finish_resume_work);
cancel_delayed_work_sync(&musb->deassert_reset_work);