]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
musb_hdrc: Stop VBUS draw on usb_gadget_unregister_driver
authorTony Lindgren <tony@atomide.com>
Wed, 15 Aug 2007 09:12:20 +0000 (12:12 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 15 Aug 2007 10:44:48 +0000 (03:44 -0700)
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: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/musb_gadget.c
drivers/usb/musb/plat_uds.c

index 8aef3931935cd72527532536abfa89869f5fe136..4aa82fe08241337a52a3fa010783eb886e5848fb 100644 (file)
@@ -1842,6 +1842,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 #endif
 
        if (musb->gadget_driver == driver) {
+
+               (void) musb_gadget_vbus_draw(&musb->g, 0);
+
                musb->xceiv.state = OTG_STATE_UNDEFINED;
                stop_activity(musb, driver);
 
index e8e41bba126cc452aa83e0a2551b07002b6bced8..b87c587c684d3c45203fe483f0bca983faf8b7da 100644 (file)
@@ -718,6 +718,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB,
 #endif /* OTG */
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
                case OTG_STATE_B_PERIPHERAL:
+               case OTG_STATE_B_IDLE:
                        musb_g_disconnect(musb);
                        break;
 #endif /* GADGET */