From: Benoit Goby Date: Thu, 1 Mar 2012 21:17:07 +0000 (-0800) Subject: HACK: usb: gadget: Fix enumeration on boot X-Git-Tag: firefly_0821_release~4090^2~533 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b94f8f691c550d1e07c21d6c672b916377c9d6d4;p=firefly-linux-kernel-4.4.55.git HACK: usb: gadget: Fix enumeration on boot 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 --- diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index ffd8fa541101..8877771fff02 100644 --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c @@ -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;