Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213537
b: refs/heads/master
c: 37b5801
h: refs/heads/master
i:
  213535: 3b4327d
v: v3
  • Loading branch information
Parirajan Muthalagu authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 72de940 commit 63777bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90593899de83a6e6fdea563d058acd2f4334e3f9
refs/heads/master: 37b5801e16d2e192fe2b20f4af33aa8c6e8786f3
8 changes: 7 additions & 1 deletion trunk/drivers/usb/gadget/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,4 +808,14 @@ enum usb_device_state {
*/
};

/*-------------------------------------------------------------------------*/

/*
* 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.
* http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
*/
#define USB_SELF_POWER_VBUS_MAX_DRAW 100

#endif /* __LINUX_USB_CH9_H */

0 comments on commit 63777bc

Please sign in to comment.