Hi,
On Fri, Dec 18, 2015 at 5:02 AM, Uwe Kleine-König
<[email protected]> wrote:
> 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 <[email protected]>
> ---
> Note I'm not entirely sure this is the right place, but this made usb
> working on my omap3 machine here (at least somewhat, still fighting with
> the last details).
> ---
> drivers/usb/musb/musb_core.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 2c624a10748d..ebb8a5455d2f 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -2108,6 +2108,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;
> +
Please check the comment around Line 2000, which states
musb_platform_init() should call for phy init. So the glue driver
should handle phy init/shutdown, not the core. This patch will cause
the phy init to be called twice for those devices which already handle
phy control in the glue driver.
Regards,
-Bin.
> if (use_dma && dev->dma_mask) {
> musb->dma_controller =
> musb_dma_controller_create(musb, musb->mregs);
> @@ -2222,7 +2226,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:
> @@ -2282,6 +2290,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);
> --
> 2.6.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html