summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_loopback.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-03-19 14:16:09 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 16:20:45 -0700
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 = {
* loopback_add - add a loopback testing configuration to a device
* @cdev: the device to support the loopback configuration
*/
-int __init loopback_add(struct usb_composite_dev *cdev)
+int __init loopback_add(struct usb_composite_dev *cdev, bool autoresume)
{
int id;
@@ -372,6 +372,10 @@ int __init loopback_add(struct usb_composite_dev *cdev)
loopback_intf.iInterface = id;
loopback_driver.iConfiguration = id;
+ /* support autoresume for remote wakeup testing */
+ if (autoresume)
+ sourcesink_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+
/* support OTG systems */
if (gadget_is_otg(cdev->gadget)) {
loopback_driver.descriptors = otg_desc;