diff options
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index e732e024a141..864c6c21c21e 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -415,14 +415,37 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
415 | 415 | ||
416 | /* USB autosuspend and autoresume */ | 416 | /* USB autosuspend and autoresume */ |
417 | #ifdef CONFIG_USB_SUSPEND | 417 | #ifdef CONFIG_USB_SUSPEND |
418 | extern int usb_autopm_set_interface(struct usb_interface *intf); | ||
418 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 419 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
419 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 420 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
420 | 421 | ||
422 | static inline void usb_autopm_enable(struct usb_interface *intf) | ||
423 | { | ||
424 | intf->pm_usage_cnt = 0; | ||
425 | usb_autopm_set_interface(intf); | ||
426 | } | ||
427 | |||
428 | static inline void usb_autopm_disable(struct usb_interface *intf) | ||
429 | { | ||
430 | intf->pm_usage_cnt = 1; | ||
431 | usb_autopm_set_interface(intf); | ||
432 | } | ||
433 | |||
421 | #else | 434 | #else |
422 | #define usb_autopm_get_interface(intf) 0 | ||
423 | #define usb_autopm_put_interface(intf) do {} while (0) | ||
424 | #endif | ||
425 | 435 | ||
436 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | ||
437 | { return 0; } | ||
438 | |||
439 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | ||
440 | { return 0; } | ||
441 | |||
442 | static inline void usb_autopm_put_interface(struct usb_interface *intf) | ||
443 | { } | ||
444 | static inline void usb_autopm_enable(struct usb_interface *intf) | ||
445 | { } | ||
446 | static inline void usb_autopm_disable(struct usb_interface *intf) | ||
447 | { } | ||
448 | #endif | ||
426 | 449 | ||
427 | /*-------------------------------------------------------------------------*/ | 450 | /*-------------------------------------------------------------------------*/ |
428 | 451 | ||