diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-12-03 14:07:05 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-01-10 05:38:52 -0500 |
commit | 8f900a9a6e2691441ad763952d640ac44220e5dc (patch) | |
tree | 5f00b9cba299d1dfa035bf3dc13cb1029e39381a /drivers/usb/gadget/gmidi.c | |
parent | 98f3a1b90795d7216de0d56157868d174317f91a (diff) |
usb: gadget: consider link speed for bMaxPower
The USB 2.0 specification says that bMaxPower is the maximum power
consumption expressed in 2 mA units and the USB 3.0 specification says
that it is expressed in 8 mA units.
This patch renames bMaxPower to MaxPower and the various /2 and *2 are
removed. Before reporting the config descriptor, the proper value is
computer based on the speed, all in-tree users are updated. MaxPower is
also increased to u16 so we can store the nokia gadget value which is
larger than the max value allowed for u8.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/gmidi.c')
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 881aab86ae99..e879e2c9f461 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -125,7 +125,7 @@ static struct usb_configuration midi_config = { | |||
125 | .bConfigurationValue = 1, | 125 | .bConfigurationValue = 1, |
126 | /* .iConfiguration = DYNAMIC */ | 126 | /* .iConfiguration = DYNAMIC */ |
127 | .bmAttributes = USB_CONFIG_ATT_ONE, | 127 | .bmAttributes = USB_CONFIG_ATT_ONE, |
128 | .bMaxPower = CONFIG_USB_GADGET_VBUS_DRAW / 2, | 128 | .MaxPower = CONFIG_USB_GADGET_VBUS_DRAW, |
129 | }; | 129 | }; |
130 | 130 | ||
131 | static int __init midi_bind_config(struct usb_configuration *c) | 131 | static int __init midi_bind_config(struct usb_configuration *c) |