usb: musb: omap2430: fix occasional musb breakage on boot
[pandora-kernel.git] / drivers / usb / musb / omap2430.c
index 74f2fb9..58ca5e4 100644 (file)
@@ -266,6 +266,8 @@ static int musb_otg_notifications(struct notifier_block *nb,
 
                if (is_otg_enabled(musb) || is_peripheral_enabled(musb))
                        if (musb->gadget_driver) {
+                               omap2430_musb_set_vbus(musb, 0);
+
                                pm_runtime_mark_last_busy(musb->controller);
                                pm_runtime_put_autosuspend(musb->controller);
                        }
@@ -511,7 +513,8 @@ static int omap2430_runtime_resume(struct device *dev)
        struct musb                     *musb = glue_to_musb(glue);
 
        omap2430_low_level_init(musb);
-       musb_writel(musb->mregs, OTG_INTERFSEL,
+       if (musb->context.otg_interfsel != 0)
+               musb_writel(musb->mregs, OTG_INTERFSEL,
                                        musb->context.otg_interfsel);
 
        otg_set_suspend(musb->xceiv, 0);