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 /include/linux/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 'include/linux/usb')
-rw-r--r-- | include/linux/usb/composite.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 935c380ffe47..acd7b0f06c8a 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -244,6 +244,10 @@ int usb_add_config(struct usb_composite_dev *, | |||
244 | * value; it should return zero on successful initialization. | 244 | * value; it should return zero on successful initialization. |
245 | * @unbind: Reverses @bind(); called as a side effect of unregistering | 245 | * @unbind: Reverses @bind(); called as a side effect of unregistering |
246 | * this driver. | 246 | * this driver. |
247 | * @suspend: Notifies when the host stops sending USB traffic, | ||
248 | * after function notifications | ||
249 | * @resume: Notifies configuration when the host restarts USB traffic, | ||
250 | * before function notifications | ||
247 | * | 251 | * |
248 | * Devices default to reporting self powered operation. Devices which rely | 252 | * Devices default to reporting self powered operation. Devices which rely |
249 | * on bus powered operation should report this in their @bind() method. | 253 | * on bus powered operation should report this in their @bind() method. |
@@ -268,6 +272,10 @@ struct usb_composite_driver { | |||
268 | 272 | ||
269 | int (*bind)(struct usb_composite_dev *); | 273 | int (*bind)(struct usb_composite_dev *); |
270 | int (*unbind)(struct usb_composite_dev *); | 274 | int (*unbind)(struct usb_composite_dev *); |
275 | |||
276 | /* global suspend hooks */ | ||
277 | void (*suspend)(struct usb_composite_dev *); | ||
278 | void (*resume)(struct usb_composite_dev *); | ||
271 | }; | 279 | }; |
272 | 280 | ||
273 | extern int usb_composite_register(struct usb_composite_driver *); | 281 | extern int usb_composite_register(struct usb_composite_driver *); |