diff options
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r-- | include/linux/pm_runtime.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 370ce0a6fe4..b776db73724 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -28,6 +28,8 @@ extern int __pm_runtime_set_status(struct device *dev, unsigned int status); | |||
28 | extern int pm_runtime_barrier(struct device *dev); | 28 | extern int pm_runtime_barrier(struct device *dev); |
29 | extern void pm_runtime_enable(struct device *dev); | 29 | extern void pm_runtime_enable(struct device *dev); |
30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
31 | extern void pm_runtime_allow(struct device *dev); | ||
32 | extern void pm_runtime_forbid(struct device *dev); | ||
31 | 33 | ||
32 | static inline bool pm_children_suspended(struct device *dev) | 34 | static inline bool pm_children_suspended(struct device *dev) |
33 | { | 35 | { |
@@ -60,6 +62,11 @@ static inline void device_set_run_wake(struct device *dev, bool enable) | |||
60 | dev->power.run_wake = enable; | 62 | dev->power.run_wake = enable; |
61 | } | 63 | } |
62 | 64 | ||
65 | static inline bool pm_runtime_suspended(struct device *dev) | ||
66 | { | ||
67 | return dev->power.runtime_status == RPM_SUSPENDED; | ||
68 | } | ||
69 | |||
63 | #else /* !CONFIG_PM_RUNTIME */ | 70 | #else /* !CONFIG_PM_RUNTIME */ |
64 | 71 | ||
65 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } | 72 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } |
@@ -78,6 +85,8 @@ static inline int __pm_runtime_set_status(struct device *dev, | |||
78 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | 85 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } |
79 | static inline void pm_runtime_enable(struct device *dev) {} | 86 | static inline void pm_runtime_enable(struct device *dev) {} |
80 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} | 87 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} |
88 | static inline void pm_runtime_allow(struct device *dev) {} | ||
89 | static inline void pm_runtime_forbid(struct device *dev) {} | ||
81 | 90 | ||
82 | static inline bool pm_children_suspended(struct device *dev) { return false; } | 91 | static inline bool pm_children_suspended(struct device *dev) { return false; } |
83 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | 92 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} |
@@ -85,6 +94,7 @@ static inline void pm_runtime_get_noresume(struct device *dev) {} | |||
85 | static inline void pm_runtime_put_noidle(struct device *dev) {} | 94 | static inline void pm_runtime_put_noidle(struct device *dev) {} |
86 | static inline bool device_run_wake(struct device *dev) { return false; } | 95 | static inline bool device_run_wake(struct device *dev) { return false; } |
87 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 96 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
97 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | ||
88 | 98 | ||
89 | #endif /* !CONFIG_PM_RUNTIME */ | 99 | #endif /* !CONFIG_PM_RUNTIME */ |
90 | 100 | ||