diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-11-12 16:19:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-07 12:59:53 -0500 |
commit | 9ac39f28b5237a629e41ccfc1f73d3a55723045c (patch) | |
tree | c161d5b62d11b6e73605a37b2562b90fff689d9e /include | |
parent | d4f373e57d3916814110968c5ea1155a8d972b5a (diff) |
USB: add asynchronous autosuspend/autoresume support
This patch (as1160b) adds support routines for asynchronous autosuspend
and autoresume, with accompanying documentation updates. There
already are several potential users of this interface, and others are
likely to arise as autosuspend support becomes more widespread.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index f72aa51f7bcd..859a88e6ce9c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -398,6 +398,7 @@ struct usb_tt; | |||
398 | * @urbnum: number of URBs submitted for the whole device | 398 | * @urbnum: number of URBs submitted for the whole device |
399 | * @active_duration: total time device is not suspended | 399 | * @active_duration: total time device is not suspended |
400 | * @autosuspend: for delayed autosuspends | 400 | * @autosuspend: for delayed autosuspends |
401 | * @autoresume: for autoresumes requested while in_interrupt | ||
401 | * @pm_mutex: protects PM operations | 402 | * @pm_mutex: protects PM operations |
402 | * @last_busy: time of last use | 403 | * @last_busy: time of last use |
403 | * @autosuspend_delay: in jiffies | 404 | * @autosuspend_delay: in jiffies |
@@ -476,6 +477,7 @@ struct usb_device { | |||
476 | 477 | ||
477 | #ifdef CONFIG_PM | 478 | #ifdef CONFIG_PM |
478 | struct delayed_work autosuspend; | 479 | struct delayed_work autosuspend; |
480 | struct work_struct autoresume; | ||
479 | struct mutex pm_mutex; | 481 | struct mutex pm_mutex; |
480 | 482 | ||
481 | unsigned long last_busy; | 483 | unsigned long last_busy; |
@@ -513,6 +515,8 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
513 | extern int usb_autopm_set_interface(struct usb_interface *intf); | 515 | extern int usb_autopm_set_interface(struct usb_interface *intf); |
514 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 516 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
515 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 517 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
518 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); | ||
519 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); | ||
516 | 520 | ||
517 | static inline void usb_autopm_enable(struct usb_interface *intf) | 521 | static inline void usb_autopm_enable(struct usb_interface *intf) |
518 | { | 522 | { |
@@ -539,8 +543,13 @@ static inline int usb_autopm_set_interface(struct usb_interface *intf) | |||
539 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | 543 | static inline int usb_autopm_get_interface(struct usb_interface *intf) |
540 | { return 0; } | 544 | { return 0; } |
541 | 545 | ||
546 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) | ||
547 | { return 0; } | ||
548 | |||
542 | static inline void usb_autopm_put_interface(struct usb_interface *intf) | 549 | static inline void usb_autopm_put_interface(struct usb_interface *intf) |
543 | { } | 550 | { } |
551 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) | ||
552 | { } | ||
544 | static inline void usb_autopm_enable(struct usb_interface *intf) | 553 | static inline void usb_autopm_enable(struct usb_interface *intf) |
545 | { } | 554 | { } |
546 | static inline void usb_autopm_disable(struct usb_interface *intf) | 555 | static inline void usb_autopm_disable(struct usb_interface *intf) |