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.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 6e81888c6222..c030cac59aac 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -12,6 +12,11 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/pm.h> 13#include <linux/pm.h>
14 14
15/* Runtime PM flag argument bits */
16#define RPM_ASYNC 0x01 /* Request is asynchronous */
17#define RPM_NOWAIT 0x02 /* Don't wait for concurrent
18 state change */
19
15#ifdef CONFIG_PM_RUNTIME 20#ifdef CONFIG_PM_RUNTIME
16 21
17extern struct workqueue_struct *pm_wq; 22extern struct workqueue_struct *pm_wq;
@@ -22,8 +27,8 @@ extern int pm_runtime_resume(struct device *dev);
22extern int pm_request_idle(struct device *dev); 27extern int pm_request_idle(struct device *dev);
23extern int pm_schedule_suspend(struct device *dev, unsigned int delay); 28extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
24extern int pm_request_resume(struct device *dev); 29extern int pm_request_resume(struct device *dev);
25extern int __pm_runtime_get(struct device *dev, bool sync); 30extern int __pm_runtime_get(struct device *dev, int rpmflags);
26extern int __pm_runtime_put(struct device *dev, bool sync); 31extern int __pm_runtime_put(struct device *dev, int rpmflags);
27extern int __pm_runtime_set_status(struct device *dev, unsigned int status); 32extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
28extern int pm_runtime_barrier(struct device *dev); 33extern int pm_runtime_barrier(struct device *dev);
29extern void pm_runtime_enable(struct device *dev); 34extern void pm_runtime_enable(struct device *dev);
@@ -81,8 +86,10 @@ static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
81 return -ENOSYS; 86 return -ENOSYS;
82} 87}
83static inline int pm_request_resume(struct device *dev) { return 0; } 88static inline int pm_request_resume(struct device *dev) { return 0; }
84static inline int __pm_runtime_get(struct device *dev, bool sync) { return 1; } 89static inline int __pm_runtime_get(struct device *dev, int rpmflags)
85static inline int __pm_runtime_put(struct device *dev, bool sync) { return 0; } 90 { return 1; }
91static inline int __pm_runtime_put(struct device *dev, int rpmflags)
92 { return 0; }
86static inline int __pm_runtime_set_status(struct device *dev, 93static inline int __pm_runtime_set_status(struct device *dev,
87 unsigned int status) { return 0; } 94 unsigned int status) { return 0; }
88static inline int pm_runtime_barrier(struct device *dev) { return 0; } 95static inline int pm_runtime_barrier(struct device *dev) { return 0; }
@@ -107,22 +114,22 @@ static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
107 114
108static inline int pm_runtime_get(struct device *dev) 115static inline int pm_runtime_get(struct device *dev)
109{ 116{
110 return __pm_runtime_get(dev, false); 117 return __pm_runtime_get(dev, RPM_ASYNC);
111} 118}
112 119
113static inline int pm_runtime_get_sync(struct device *dev) 120static inline int pm_runtime_get_sync(struct device *dev)
114{ 121{
115 return __pm_runtime_get(dev, true); 122 return __pm_runtime_get(dev, 0);
116} 123}
117 124
118static inline int pm_runtime_put(struct device *dev) 125static inline int pm_runtime_put(struct device *dev)
119{ 126{
120 return __pm_runtime_put(dev, false); 127 return __pm_runtime_put(dev, RPM_ASYNC);
121} 128}
122 129
123static inline int pm_runtime_put_sync(struct device *dev) 130static inline int pm_runtime_put_sync(struct device *dev)
124{ 131{
125 return __pm_runtime_put(dev, true); 132 return __pm_runtime_put(dev, 0);
126} 133}
127 134
128static inline int pm_runtime_set_active(struct device *dev) 135static inline int pm_runtime_set_active(struct device *dev)