Commit c5d9f0a5 authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Stop VBUS draw on usb_gadget_unregister_driver

If musb_gadget_vbus_draw() also toggles a clock like tusb does,
USB clock will stay on after rmmoding a gadget driver. This
can block omap idle states.

Also handle disconnect as b_idle so that musb_gadget_vbus_draw()
gets called.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 9274e1e0
...@@ -1842,6 +1842,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) ...@@ -1842,6 +1842,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
#endif #endif
if (musb->gadget_driver == driver) { if (musb->gadget_driver == driver) {
(void) musb_gadget_vbus_draw(&musb->g, 0);
musb->xceiv.state = OTG_STATE_UNDEFINED; musb->xceiv.state = OTG_STATE_UNDEFINED;
stop_activity(musb, driver); stop_activity(musb, driver);
......
...@@ -718,6 +718,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, ...@@ -718,6 +718,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB,
#endif /* OTG */ #endif /* OTG */
#ifdef CONFIG_USB_GADGET_MUSB_HDRC #ifdef CONFIG_USB_GADGET_MUSB_HDRC
case OTG_STATE_B_PERIPHERAL: case OTG_STATE_B_PERIPHERAL:
case OTG_STATE_B_IDLE:
musb_g_disconnect(musb); musb_g_disconnect(musb);
break; break;
#endif /* GADGET */ #endif /* GADGET */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment