diff options
Diffstat (limited to 'include/linux/pm_runtime.h')
| -rw-r--r-- | include/linux/pm_runtime.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 3ec2358f8692..d34f067e2a7f 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -40,6 +40,7 @@ extern int pm_generic_runtime_idle(struct device *dev); | |||
| 40 | extern int pm_generic_runtime_suspend(struct device *dev); | 40 | extern int pm_generic_runtime_suspend(struct device *dev); |
| 41 | extern int pm_generic_runtime_resume(struct device *dev); | 41 | extern int pm_generic_runtime_resume(struct device *dev); |
| 42 | extern void pm_runtime_no_callbacks(struct device *dev); | 42 | extern void pm_runtime_no_callbacks(struct device *dev); |
| 43 | extern void pm_runtime_irq_safe(struct device *dev); | ||
| 43 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); | 44 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); |
| 44 | extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); | 45 | extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); |
| 45 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); | 46 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); |
| @@ -77,7 +78,13 @@ static inline void device_set_run_wake(struct device *dev, bool enable) | |||
| 77 | 78 | ||
| 78 | static inline bool pm_runtime_suspended(struct device *dev) | 79 | static inline bool pm_runtime_suspended(struct device *dev) |
| 79 | { | 80 | { |
| 80 | return dev->power.runtime_status == RPM_SUSPENDED; | 81 | return dev->power.runtime_status == RPM_SUSPENDED |
| 82 | && !dev->power.disable_depth; | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline bool pm_runtime_enabled(struct device *dev) | ||
| 86 | { | ||
| 87 | return !dev->power.disable_depth; | ||
| 81 | } | 88 | } |
| 82 | 89 | ||
| 83 | static inline void pm_runtime_mark_last_busy(struct device *dev) | 90 | static inline void pm_runtime_mark_last_busy(struct device *dev) |
| @@ -118,11 +125,13 @@ static inline void pm_runtime_put_noidle(struct device *dev) {} | |||
| 118 | static inline bool device_run_wake(struct device *dev) { return false; } | 125 | static inline bool device_run_wake(struct device *dev) { return false; } |
| 119 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 126 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
| 120 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 127 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
| 128 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | ||
| 121 | 129 | ||
| 122 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } | 130 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } |
| 123 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | 131 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } |
| 124 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | 132 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } |
| 125 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 133 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
| 134 | static inline void pm_runtime_irq_safe(struct device *dev) {} | ||
| 126 | 135 | ||
| 127 | static inline void pm_runtime_mark_last_busy(struct device *dev) {} | 136 | static inline void pm_runtime_mark_last_busy(struct device *dev) {} |
| 128 | static inline void __pm_runtime_use_autosuspend(struct device *dev, | 137 | static inline void __pm_runtime_use_autosuspend(struct device *dev, |
| @@ -195,6 +204,11 @@ static inline int pm_runtime_put_sync(struct device *dev) | |||
| 195 | return __pm_runtime_idle(dev, RPM_GET_PUT); | 204 | return __pm_runtime_idle(dev, RPM_GET_PUT); |
| 196 | } | 205 | } |
| 197 | 206 | ||
| 207 | static inline int pm_runtime_put_sync_suspend(struct device *dev) | ||
| 208 | { | ||
| 209 | return __pm_runtime_suspend(dev, RPM_GET_PUT); | ||
| 210 | } | ||
| 211 | |||
| 198 | static inline int pm_runtime_put_sync_autosuspend(struct device *dev) | 212 | static inline int pm_runtime_put_sync_autosuspend(struct device *dev) |
| 199 | { | 213 | { |
| 200 | return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO); | 214 | return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO); |
