diff options
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r-- | include/linux/pm_runtime.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 44087044910f..b776db737244 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 | { |
@@ -50,6 +52,21 @@ static inline void pm_runtime_put_noidle(struct device *dev) | |||
50 | atomic_add_unless(&dev->power.usage_count, -1, 0); | 52 | atomic_add_unless(&dev->power.usage_count, -1, 0); |
51 | } | 53 | } |
52 | 54 | ||
55 | static inline bool device_run_wake(struct device *dev) | ||
56 | { | ||
57 | return dev->power.run_wake; | ||
58 | } | ||
59 | |||
60 | static inline void device_set_run_wake(struct device *dev, bool enable) | ||
61 | { | ||
62 | dev->power.run_wake = enable; | ||
63 | } | ||
64 | |||
65 | static inline bool pm_runtime_suspended(struct device *dev) | ||
66 | { | ||
67 | return dev->power.runtime_status == RPM_SUSPENDED; | ||
68 | } | ||
69 | |||
53 | #else /* !CONFIG_PM_RUNTIME */ | 70 | #else /* !CONFIG_PM_RUNTIME */ |
54 | 71 | ||
55 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } | 72 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } |
@@ -68,11 +85,16 @@ static inline int __pm_runtime_set_status(struct device *dev, | |||
68 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | 85 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } |
69 | static inline void pm_runtime_enable(struct device *dev) {} | 86 | static inline void pm_runtime_enable(struct device *dev) {} |
70 | 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) {} | ||
71 | 90 | ||
72 | static inline bool pm_children_suspended(struct device *dev) { return false; } | 91 | static inline bool pm_children_suspended(struct device *dev) { return false; } |
73 | 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) {} |
74 | static inline void pm_runtime_get_noresume(struct device *dev) {} | 93 | static inline void pm_runtime_get_noresume(struct device *dev) {} |
75 | static inline void pm_runtime_put_noidle(struct device *dev) {} | 94 | static inline void pm_runtime_put_noidle(struct device *dev) {} |
95 | static inline bool device_run_wake(struct device *dev) { return false; } | ||
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; } | ||
76 | 98 | ||
77 | #endif /* !CONFIG_PM_RUNTIME */ | 99 | #endif /* !CONFIG_PM_RUNTIME */ |
78 | 100 | ||