|
@@ -1074,7 +1074,13 @@ static int composite_bind(struct usb_gadget *gadget)
|
|
|
cdev->bufsiz = USB_BUFSIZ;
|
|
|
cdev->driver = composite;
|
|
|
|
|
|
- usb_gadget_set_selfpowered(gadget);
|
|
|
+ /*
|
|
|
+ * As per USB compliance update, a device that is actively drawing
|
|
|
+ * more than 100mA from USB must report itself as bus-powered in
|
|
|
+ * the GetStatus(DEVICE) call.
|
|
|
+ */
|
|
|
+ if (CONFIG_USB_GADGET_VBUS_DRAW <= USB_SELF_POWER_VBUS_MAX_DRAW)
|
|
|
+ usb_gadget_set_selfpowered(gadget);
|
|
|
|
|
|
/* interface and string IDs start at zero via kzalloc.
|
|
|
* we force endpoints to start unassigned; few controller
|