diff options
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r-- | include/linux/pm_runtime.h | 23 |
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 | ||
17 | extern struct workqueue_struct *pm_wq; | 22 | extern struct workqueue_struct *pm_wq; |
@@ -22,8 +27,8 @@ extern int pm_runtime_resume(struct device *dev); | |||
22 | extern int pm_request_idle(struct device *dev); | 27 | extern int pm_request_idle(struct device *dev); |
23 | extern int pm_schedule_suspend(struct device *dev, unsigned int delay); | 28 | extern int pm_schedule_suspend(struct device *dev, unsigned int delay); |
24 | extern int pm_request_resume(struct device *dev); | 29 | extern int pm_request_resume(struct device *dev); |
25 | extern int __pm_runtime_get(struct device *dev, bool sync); | 30 | extern int __pm_runtime_get(struct device *dev, int rpmflags); |
26 | extern int __pm_runtime_put(struct device *dev, bool sync); | 31 | extern int __pm_runtime_put(struct device *dev, int rpmflags); |
27 | extern int __pm_runtime_set_status(struct device *dev, unsigned int status); | 32 | extern int __pm_runtime_set_status(struct device *dev, unsigned int status); |
28 | extern int pm_runtime_barrier(struct device *dev); | 33 | extern int pm_runtime_barrier(struct device *dev); |
29 | extern void pm_runtime_enable(struct device *dev); | 34 | extern 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 | } |
83 | static inline int pm_request_resume(struct device *dev) { return 0; } | 88 | static inline int pm_request_resume(struct device *dev) { return 0; } |
84 | static inline int __pm_runtime_get(struct device *dev, bool sync) { return 1; } | 89 | static inline int __pm_runtime_get(struct device *dev, int rpmflags) |
85 | static inline int __pm_runtime_put(struct device *dev, bool sync) { return 0; } | 90 | { return 1; } |
91 | static inline int __pm_runtime_put(struct device *dev, int rpmflags) | ||
92 | { return 0; } | ||
86 | static inline int __pm_runtime_set_status(struct device *dev, | 93 | static inline int __pm_runtime_set_status(struct device *dev, |
87 | unsigned int status) { return 0; } | 94 | unsigned int status) { return 0; } |
88 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | 95 | static 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 | ||
108 | static inline int pm_runtime_get(struct device *dev) | 115 | static 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 | ||
113 | static inline int pm_runtime_get_sync(struct device *dev) | 120 | static 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 | ||
118 | static inline int pm_runtime_put(struct device *dev) | 125 | static 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 | ||
123 | static inline int pm_runtime_put_sync(struct device *dev) | 130 | static 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 | ||
128 | static inline int pm_runtime_set_active(struct device *dev) | 135 | static inline int pm_runtime_set_active(struct device *dev) |