aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_runtime.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r--include/linux/pm_runtime.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index f271860c78d5..7d7e09efff9b 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -47,6 +47,7 @@ extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
47extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); 47extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
48extern void pm_runtime_update_max_time_suspended(struct device *dev, 48extern void pm_runtime_update_max_time_suspended(struct device *dev,
49 s64 delta_ns); 49 s64 delta_ns);
50extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable);
50 51
51static inline bool pm_children_suspended(struct device *dev) 52static inline bool pm_children_suspended(struct device *dev)
52{ 53{
@@ -80,6 +81,12 @@ static inline bool pm_runtime_suspended(struct device *dev)
80 && !dev->power.disable_depth; 81 && !dev->power.disable_depth;
81} 82}
82 83
84static inline bool pm_runtime_active(struct device *dev)
85{
86 return dev->power.runtime_status == RPM_ACTIVE
87 || dev->power.disable_depth;
88}
89
83static inline bool pm_runtime_status_suspended(struct device *dev) 90static inline bool pm_runtime_status_suspended(struct device *dev)
84{ 91{
85 return dev->power.runtime_status == RPM_SUSPENDED; 92 return dev->power.runtime_status == RPM_SUSPENDED;
@@ -132,6 +139,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
132static inline bool device_run_wake(struct device *dev) { return false; } 139static inline bool device_run_wake(struct device *dev) { return false; }
133static inline void device_set_run_wake(struct device *dev, bool enable) {} 140static inline void device_set_run_wake(struct device *dev, bool enable) {}
134static inline bool pm_runtime_suspended(struct device *dev) { return false; } 141static inline bool pm_runtime_suspended(struct device *dev) { return false; }
142static inline bool pm_runtime_active(struct device *dev) { return true; }
135static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } 143static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
136static inline bool pm_runtime_enabled(struct device *dev) { return false; } 144static inline bool pm_runtime_enabled(struct device *dev) { return false; }
137 145
@@ -149,6 +157,8 @@ static inline void pm_runtime_set_autosuspend_delay(struct device *dev,
149 int delay) {} 157 int delay) {}
150static inline unsigned long pm_runtime_autosuspend_expiration( 158static inline unsigned long pm_runtime_autosuspend_expiration(
151 struct device *dev) { return 0; } 159 struct device *dev) { return 0; }
160static inline void pm_runtime_set_memalloc_noio(struct device *dev,
161 bool enable){}
152 162
153#endif /* !CONFIG_PM_RUNTIME */ 163#endif /* !CONFIG_PM_RUNTIME */
154 164