USB: musb: gadget: set otg tranceiver to idle when registering gadget
authorArnaud Mandy <ext-arnaud.2.mandy@nokia.com>
Tue, 15 Dec 2009 11:29:58 +0000 (13:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Dec 2009 19:34:17 +0000 (11:34 -0800)
When registering gadget driver, the state of the transceiver
must be set from undefined (no gadget) to b_idle.

Module unload sets the transceiver state to undefined state.
After the first load/unload pair, the reset irq will be lost.

Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@nokia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/musb_gadget.c

index 0c36925c5934aee21a7d58e0cbb86af62db87bee..e164999bd3643dc00420a1f9564c2cdd8ccf722c 100644 (file)
@@ -1731,6 +1731,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
                spin_lock_irqsave(&musb->lock, flags);
 
                otg_set_peripheral(musb->xceiv, &musb->g);
+               musb->xceiv->state = OTG_STATE_B_IDLE;
                musb->is_active = 1;
 
                /* FIXME this ignores the softconnect flag.  Drivers are