summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-03-19 14:14:17 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 16:20:45 -0700
commit8942939a6c83f34615de5ae041cc9ca846923f94 (patch)
tree4d3715a1f4ddca640ed60efb5fffabfcc785538e /drivers/usb
parente1e609be49c9d345e8b67a122a7cdae48ad27c7e (diff)
downloadlinux-8942939a6c83f34615de5ae041cc9ca846923f94.tar.gz
linux-8942939a6c83f34615de5ae041cc9ca846923f94.tar.bz2
linux-8942939a6c83f34615de5ae041cc9ca846923f94.zip
USB: gadget: composite device-level suspend/resume hooks
Address one open question in the composite gadget framework: Yes, we should have device-level suspend/resume callbacks in addition to the function-level ones. We have at least one scenario (with gadget zero in OTG test mode) that's awkward to handle without it. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/composite.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 40f1da77a006..59e85234fa0a 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1014,7 +1014,7 @@ composite_suspend(struct usb_gadget *gadget)
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_function *f;
- /* REVISIT: should we have config and device level
+ /* REVISIT: should we have config level
* suspend/resume callbacks?
*/
DBG(cdev, "suspend\n");
@@ -1024,6 +1024,8 @@ composite_suspend(struct usb_gadget *gadget)
f->suspend(f);
}
}
+ if (composite->suspend)
+ composite->suspend(cdev);
}
static void
@@ -1032,10 +1034,12 @@ composite_resume(struct usb_gadget *gadget)
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_function *f;
- /* REVISIT: should we have config and device level
+ /* REVISIT: should we have config level
* suspend/resume callbacks?
*/
DBG(cdev, "resume\n");
+ if (composite->resume)
+ composite->resume(cdev);
if (cdev->config) {
list_for_each_entry(f, &cdev->config->functions, list) {
if (f->resume)