HACK: usb: gadget: Fix enumeration on boot
authorBenoit Goby <benoit@android.com>
Thu, 1 Mar 2012 21:17:07 +0000 (13:17 -0800)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 22:51:55 +0000 (15:51 -0700)
The Android gadget driver disconnects the gadget on bind
and expects the gadget to stay disconnected until it calls
usb_gadget_connect when userspace is ready. Removed the call
to usb_gadget_connect in usb_gadget_probe_driver to avoid
enabling the pullup before userspace is ready.

Change-Id: I63707ac6e16a44eca52351a4bf80407d25fbd35e
Signed-off-by: Benoit Goby <benoit@android.com>
drivers/usb/gadget/udc-core.c

index ffd8fa5411015f823bc5701777e20cd928848f56..8877771fff02805ff583d081c10bd00275883fdf 100644 (file)
@@ -335,7 +335,15 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
                driver->unbind(udc->gadget);
                goto err1;
        }
-       usb_gadget_connect(udc->gadget);
+       /*
+        * HACK: The Android gadget driver disconnects the gadget
+        * on bind and expects the gadget to stay disconnected until
+        * it calls usb_gadget_connect when userspace is ready. Remove
+        * the call to usb_gadget_connect bellow to avoid enabling the
+        * pullup before userspace is ready.
+        *
+        * usb_gadget_connect(udc->gadget);
+        */
 
        kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
        return 0;