From a0431f2a3d8ceb9c9d72a6526bb4bc5145d180f0 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Tue, 26 Feb 2013 02:07:00 +0200 Subject: [PATCH] usb: musb: omap2430: turn off vbus on cable disconnect On USB_EVENT_ID event the musb glue enables VBUS by calling omap2430_musb_set_vbus(musb, 1) that sets the session bit, but on USB_EVENT_NONE reverse action is never made, and that breaks PM. Disable VBUS unconditionally on USB_EVENT_NONE to be sure musb session is ended on cable unplug so that PM works. --- drivers/usb/musb/omap2430.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 74f2fb98f1ee..81f05f3ce9c9 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -264,6 +264,8 @@ static int musb_otg_notifications(struct notifier_block *nb, case USB_EVENT_NONE: dev_dbg(musb->controller, "VBUS Disconnect\n"); + omap2430_musb_set_vbus(musb, 0); + if (is_otg_enabled(musb) || is_peripheral_enabled(musb)) if (musb->gadget_driver) { pm_runtime_mark_last_busy(musb->controller); -- 2.39.2