twl4030-otg: do not mess the state but preserve linkstat
authorPaul Fertser <fercerpav@gmail.com>
Tue, 2 Nov 2010 09:46:39 +0000 (12:46 +0300)
committerPaul Fertser <fercerpav@gmail.com>
Fri, 5 Nov 2010 12:03:44 +0000 (15:03 +0300)
This makes charging and being gadget (while not in the forced
hostmode obviously) work properly while not harming the hostmode
functionality.

drivers/usb/otg/twl4030-usb.c

index ecffb2a..4570b7a 100644 (file)
@@ -371,6 +371,7 @@ static enum linkstat twl4030_usb_linkstat(struct twl4030_usb *twl)
 
        spin_lock_irq(&twl->lock);
        twl->linkstat = linkstat;
+#if 0
        if (linkstat == USB_LINK_ID) {
                twl->otg.default_a = true;
                twl->otg.state = OTG_STATE_A_IDLE;
@@ -378,6 +379,7 @@ static enum linkstat twl4030_usb_linkstat(struct twl4030_usb *twl)
                twl->otg.default_a = false;
                twl->otg.state = OTG_STATE_B_IDLE;
        }
+#endif
        spin_unlock_irq(&twl->lock);
 
        return linkstat;