diff options
Diffstat (limited to 'drivers/usb/gadget/f_loopback.c')
-rw-r--r-- | drivers/usb/gadget/f_loopback.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c index 8affe1dfc2c1..eb6ddfc20857 100644 --- a/drivers/usb/gadget/f_loopback.c +++ b/drivers/usb/gadget/f_loopback.c | |||
@@ -100,7 +100,7 @@ static struct usb_endpoint_descriptor hs_loop_source_desc = { | |||
100 | .bDescriptorType = USB_DT_ENDPOINT, | 100 | .bDescriptorType = USB_DT_ENDPOINT, |
101 | 101 | ||
102 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | 102 | .bmAttributes = USB_ENDPOINT_XFER_BULK, |
103 | .wMaxPacketSize = __constant_cpu_to_le16(512), | 103 | .wMaxPacketSize = cpu_to_le16(512), |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static struct usb_endpoint_descriptor hs_loop_sink_desc = { | 106 | static struct usb_endpoint_descriptor hs_loop_sink_desc = { |
@@ -108,7 +108,7 @@ static struct usb_endpoint_descriptor hs_loop_sink_desc = { | |||
108 | .bDescriptorType = USB_DT_ENDPOINT, | 108 | .bDescriptorType = USB_DT_ENDPOINT, |
109 | 109 | ||
110 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | 110 | .bmAttributes = USB_ENDPOINT_XFER_BULK, |
111 | .wMaxPacketSize = __constant_cpu_to_le16(512), | 111 | .wMaxPacketSize = cpu_to_le16(512), |
112 | }; | 112 | }; |
113 | 113 | ||
114 | static struct usb_descriptor_header *hs_loopback_descs[] = { | 114 | static struct usb_descriptor_header *hs_loopback_descs[] = { |
@@ -359,7 +359,7 @@ static struct usb_configuration loopback_driver = { | |||
359 | * loopback_add - add a loopback testing configuration to a device | 359 | * loopback_add - add a loopback testing configuration to a device |
360 | * @cdev: the device to support the loopback configuration | 360 | * @cdev: the device to support the loopback configuration |
361 | */ | 361 | */ |
362 | int __init loopback_add(struct usb_composite_dev *cdev) | 362 | int __init loopback_add(struct usb_composite_dev *cdev, bool autoresume) |
363 | { | 363 | { |
364 | int id; | 364 | int id; |
365 | 365 | ||
@@ -372,6 +372,10 @@ int __init loopback_add(struct usb_composite_dev *cdev) | |||
372 | loopback_intf.iInterface = id; | 372 | loopback_intf.iInterface = id; |
373 | loopback_driver.iConfiguration = id; | 373 | loopback_driver.iConfiguration = id; |
374 | 374 | ||
375 | /* support autoresume for remote wakeup testing */ | ||
376 | if (autoresume) | ||
377 | sourcesink_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP; | ||
378 | |||
375 | /* support OTG systems */ | 379 | /* support OTG systems */ |
376 | if (gadget_is_otg(cdev->gadget)) { | 380 | if (gadget_is_otg(cdev->gadget)) { |
377 | loopback_driver.descriptors = otg_desc; | 381 | loopback_driver.descriptors = otg_desc; |