Skip to content

Commit

Permalink
usb: musb: core: call init and shutdown for the usb phy
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Felipe Balbi committed Dec 22, 2015
1 parent 8a0859b commit 39cee20
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -2256,7 +2260,11 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
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:
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 39cee20

Please sign in to comment.