aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_loopback.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-03-19 17:16:09 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:45 -0400
commitab943a2e125b098489ccaa0166c2c52f8266d9ed (patch)
treeb50c7e28683f0cb0d982f0e9f164d2b5844eefef /drivers/usb/gadget/f_loopback.c
parent8942939a6c83f34615de5ae041cc9ca846923f94 (diff)
USB: gadget: gadget zero uses new suspend/resume hooks
Use the new device-level suspend/resume hooks for Gadget Zero; always enable them with the OTG test mode; and support remote wakeup on both configurations even in non-OTG mode. This ensures that both configurations can pass the USBCV remote wakeup tests when the OTG test mode is enabled. This changes behavior by adding autoresume support to the loopback config even in non-OTG mode; the test failure was that it didn't work in OTG mode. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/f_loopback.c')
-rw-r--r--drivers/usb/gadget/f_loopback.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c
index 83301bdcdd1..eb6ddfc2085 100644
--- a/drivers/usb/gadget/f_loopback.c
+++ b/drivers/usb/gadget/f_loopback.c
@@ -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 */
362int __init loopback_add(struct usb_composite_dev *cdev) 362int __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;