diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-03-19 17:14:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:20:45 -0400 |
commit | 8942939a6c83f34615de5ae041cc9ca846923f94 (patch) | |
tree | 4d3715a1f4ddca640ed60efb5fffabfcc785538e /drivers/usb | |
parent | e1e609be49c9d345e8b67a122a7cdae48ad27c7e (diff) |
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.c | 8 |
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) | |||
1014 | struct usb_composite_dev *cdev = get_gadget_data(gadget); | 1014 | struct usb_composite_dev *cdev = get_gadget_data(gadget); |
1015 | struct usb_function *f; | 1015 | struct usb_function *f; |
1016 | 1016 | ||
1017 | /* REVISIT: should we have config and device level | 1017 | /* REVISIT: should we have config level |
1018 | * suspend/resume callbacks? | 1018 | * suspend/resume callbacks? |
1019 | */ | 1019 | */ |
1020 | DBG(cdev, "suspend\n"); | 1020 | DBG(cdev, "suspend\n"); |
@@ -1024,6 +1024,8 @@ composite_suspend(struct usb_gadget *gadget) | |||
1024 | f->suspend(f); | 1024 | f->suspend(f); |
1025 | } | 1025 | } |
1026 | } | 1026 | } |
1027 | if (composite->suspend) | ||
1028 | composite->suspend(cdev); | ||
1027 | } | 1029 | } |
1028 | 1030 | ||
1029 | static void | 1031 | static void |
@@ -1032,10 +1034,12 @@ composite_resume(struct usb_gadget *gadget) | |||
1032 | struct usb_composite_dev *cdev = get_gadget_data(gadget); | 1034 | struct usb_composite_dev *cdev = get_gadget_data(gadget); |
1033 | struct usb_function *f; | 1035 | struct usb_function *f; |
1034 | 1036 | ||
1035 | /* REVISIT: should we have config and device level | 1037 | /* REVISIT: should we have config level |
1036 | * suspend/resume callbacks? | 1038 | * suspend/resume callbacks? |
1037 | */ | 1039 | */ |
1038 | DBG(cdev, "resume\n"); | 1040 | DBG(cdev, "resume\n"); |
1041 | if (composite->resume) | ||
1042 | composite->resume(cdev); | ||
1039 | if (cdev->config) { | 1043 | if (cdev->config) { |
1040 | list_for_each_entry(f, &cdev->config->functions, list) { | 1044 | list_for_each_entry(f, &cdev->config->functions, list) { |
1041 | if (f->resume) | 1045 | if (f->resume) |