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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index d19f1cca7f74..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);
40extern int pm_generic_runtime_suspend(struct device *dev); 40extern int pm_generic_runtime_suspend(struct device *dev);
41extern int pm_generic_runtime_resume(struct device *dev); 41extern int pm_generic_runtime_resume(struct device *dev);
42extern void pm_runtime_no_callbacks(struct device *dev); 42extern void pm_runtime_no_callbacks(struct device *dev);
43extern void pm_runtime_irq_safe(struct device *dev);
43extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); 44extern void __pm_runtime_use_autosuspend(struct device *dev, bool use);
44extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); 45extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
45extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); 46extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
@@ -81,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev)
81 && !dev->power.disable_depth; 82 && !dev->power.disable_depth;
82} 83}
83 84
85static inline bool pm_runtime_enabled(struct device *dev)
86{
87 return !dev->power.disable_depth;
88}
89
84static inline void pm_runtime_mark_last_busy(struct device *dev) 90static inline void pm_runtime_mark_last_busy(struct device *dev)
85{ 91{
86 ACCESS_ONCE(dev->power.last_busy) = jiffies; 92 ACCESS_ONCE(dev->power.last_busy) = jiffies;
@@ -119,11 +125,13 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
119static inline bool device_run_wake(struct device *dev) { return false; } 125static inline bool device_run_wake(struct device *dev) { return false; }
120static inline void device_set_run_wake(struct device *dev, bool enable) {} 126static inline void device_set_run_wake(struct device *dev, bool enable) {}
121static inline bool pm_runtime_suspended(struct device *dev) { return false; } 127static inline bool pm_runtime_suspended(struct device *dev) { return false; }
128static inline bool pm_runtime_enabled(struct device *dev) { return false; }
122 129
123static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } 130static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
124static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } 131static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
125static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } 132static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
126static inline void pm_runtime_no_callbacks(struct device *dev) {} 133static inline void pm_runtime_no_callbacks(struct device *dev) {}
134static inline void pm_runtime_irq_safe(struct device *dev) {}
127 135
128static inline void pm_runtime_mark_last_busy(struct device *dev) {} 136static inline void pm_runtime_mark_last_busy(struct device *dev) {}
129static inline void __pm_runtime_use_autosuspend(struct device *dev, 137static inline void __pm_runtime_use_autosuspend(struct device *dev,
@@ -196,6 +204,11 @@ static inline int pm_runtime_put_sync(struct device *dev)
196 return __pm_runtime_idle(dev, RPM_GET_PUT); 204 return __pm_runtime_idle(dev, RPM_GET_PUT);
197} 205}
198 206
207static inline int pm_runtime_put_sync_suspend(struct device *dev)
208{
209 return __pm_runtime_suspend(dev, RPM_GET_PUT);
210}
211
199static inline int pm_runtime_put_sync_autosuspend(struct device *dev) 212static inline int pm_runtime_put_sync_autosuspend(struct device *dev)
200{ 213{
201 return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO); 214 return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO);