Ugly hack which comes from Android removes a call
to usb_gadget_connect() in udc_bind_to_driver() to
prevent android/slp gadget from communication before
userspace explicitly enables it.
Mainline gadgets (like g_ffs) expect this function
to be called as they don't have any sysfs interface
to enable them later.
As for usb-host API tests we need to use dummy_hcd
and g_ffs let's call usb_gadget_connect() for all
dummy_udc's.
Change-Id: I782bbb51c54e0b87ff6ef976070b6d8870a1a745
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
* the call to usb_gadget_connect bellow to avoid enabling the
* pullup before userspace is ready.
*
- * usb_gadget_connect(udc->gadget);
+ * HACK: Apart from android and slp gadget we would like to use
+ * also standard mainline gadgets with dummy_hcd. Those gadgets
+ * expects to be connected right after bind().
*/
+ if (strstr(dev_name(&udc->dev), "dummy_udc") != NULL)
+ usb_gadget_connect(udc->gadget);
+
kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
return 0;