diff options
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r-- | drivers/usb/gadget/composite.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7b5cc16e4a0b..21dc0da36ab7 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
@@ -1126,7 +1126,7 @@ static int composite_bind(struct usb_gadget *gadget) | |||
1126 | cdev->desc = *composite->dev; | 1126 | cdev->desc = *composite->dev; |
1127 | cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; | 1127 | cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; |
1128 | 1128 | ||
1129 | /* stirng overrides */ | 1129 | /* string overrides */ |
1130 | if (iManufacturer || !cdev->desc.iManufacturer) { | 1130 | if (iManufacturer || !cdev->desc.iManufacturer) { |
1131 | if (!iManufacturer && !composite->iManufacturer && | 1131 | if (!iManufacturer && !composite->iManufacturer && |
1132 | !*composite_manufacturer) | 1132 | !*composite_manufacturer) |
@@ -1188,6 +1188,8 @@ composite_suspend(struct usb_gadget *gadget) | |||
1188 | composite->suspend(cdev); | 1188 | composite->suspend(cdev); |
1189 | 1189 | ||
1190 | cdev->suspended = 1; | 1190 | cdev->suspended = 1; |
1191 | |||
1192 | usb_gadget_vbus_draw(gadget, 2); | ||
1191 | } | 1193 | } |
1192 | 1194 | ||
1193 | static void | 1195 | static void |
@@ -1195,6 +1197,7 @@ composite_resume(struct usb_gadget *gadget) | |||
1195 | { | 1197 | { |
1196 | struct usb_composite_dev *cdev = get_gadget_data(gadget); | 1198 | struct usb_composite_dev *cdev = get_gadget_data(gadget); |
1197 | struct usb_function *f; | 1199 | struct usb_function *f; |
1200 | u8 maxpower; | ||
1198 | 1201 | ||
1199 | /* REVISIT: should we have config level | 1202 | /* REVISIT: should we have config level |
1200 | * suspend/resume callbacks? | 1203 | * suspend/resume callbacks? |
@@ -1207,6 +1210,11 @@ composite_resume(struct usb_gadget *gadget) | |||
1207 | if (f->resume) | 1210 | if (f->resume) |
1208 | f->resume(f); | 1211 | f->resume(f); |
1209 | } | 1212 | } |
1213 | |||
1214 | maxpower = cdev->config->bMaxPower; | ||
1215 | |||
1216 | usb_gadget_vbus_draw(gadget, maxpower ? | ||
1217 | (2 * maxpower) : CONFIG_USB_GADGET_VBUS_DRAW); | ||
1210 | } | 1218 | } |
1211 | 1219 | ||
1212 | cdev->suspended = 0; | 1220 | cdev->suspended = 0; |