source: GPL/trunk/include/linux/pm_runtime.h

Last change on this file was 679, checked in by David Azarewicz, 4 years ago

Merge changes from Paul's uniaud32next branch.

File size: 5.4 KB
Line 
1#ifndef _LINUX_PM_RUNTIME_H
2#define _LINUX_PM_RUNTIME_H
3
4#include <asm/errno.h>
5#include <linux/pm.h>
6
7/* Runtime PM flag argument bits */
8#define RPM_ASYNC 0x01 /* Request is asynchronous */
9#define RPM_NOWAIT 0x02 /* Don't wait for concurrent
10 state change */
11#define RPM_GET_PUT 0x04 /* Increment/decrement the
12 usage_count */
13#define RPM_AUTO 0x08 /* Use autosuspend_delay */
14
15static inline bool pm_runtime_active(struct device *dev) { return true; }
16
17static inline bool queue_pm_work(struct work_struct *work) { return false; }
18
19static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
20static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
21static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
22static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
23
24static inline int __pm_runtime_idle(struct device *dev, int rpmflags)
25{
26 return -ENOSYS;
27}
28static inline int __pm_runtime_suspend(struct device *dev, int rpmflags)
29{
30 return -ENOSYS;
31}
32static inline int __pm_runtime_resume(struct device *dev, int rpmflags)
33{
34 return 1;
35}
36static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
37{
38 return -ENOSYS;
39}
40static inline int __pm_runtime_set_status(struct device *dev,
41 unsigned int status) { return 0; }
42static inline int pm_runtime_barrier(struct device *dev) { return 0; }
43static inline void pm_runtime_enable(struct device *dev) {}
44static inline void __pm_runtime_disable(struct device *dev, bool c) {}
45static inline void pm_runtime_allow(struct device *dev) {}
46static inline void pm_runtime_forbid(struct device *dev) {}
47
48static inline bool pm_children_suspended(struct device *dev) { return false; }
49static inline void pm_runtime_get_noresume(struct device *dev) {}
50static inline void pm_runtime_put_noidle(struct device *dev) {}
51static inline bool device_run_wake(struct device *dev) { return false; }
52static inline void device_set_run_wake(struct device *dev, bool enable) {}
53static inline bool pm_runtime_suspended(struct device *dev) { return false; }
54static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
55static inline bool pm_runtime_suspended_if_enabled(struct device *dev) { return false; }
56static inline bool pm_runtime_enabled(struct device *dev) { return false; }
57
58static inline void pm_runtime_no_callbacks(struct device *dev) {}
59static inline void pm_runtime_irq_safe(struct device *dev) {}
60static inline bool pm_runtime_is_irq_safe(struct device *dev) { return false; }
61
62static inline bool pm_runtime_callbacks_present(struct device *dev) { return false; }
63static inline void pm_runtime_mark_last_busy(struct device *dev) {}
64static inline void __pm_runtime_use_autosuspend(struct device *dev,
65 bool use) {}
66static inline void pm_runtime_set_autosuspend_delay(struct device *dev,
67 int delay) {}
68static inline unsigned long pm_runtime_autosuspend_expiration(
69 struct device *dev) { return 0; }
70static inline void pm_runtime_set_memalloc_noio(struct device *dev,
71 bool enable){}
72
73static inline int pm_runtime_idle(struct device *dev)
74{
75 return __pm_runtime_idle(dev, 0);
76}
77
78static inline int pm_runtime_suspend(struct device *dev)
79{
80 return __pm_runtime_suspend(dev, 0);
81}
82
83static inline int pm_runtime_autosuspend(struct device *dev)
84{
85 return __pm_runtime_suspend(dev, RPM_AUTO);
86}
87
88static inline int pm_runtime_resume(struct device *dev)
89{
90 return __pm_runtime_resume(dev, 0);
91}
92
93static inline int pm_request_idle(struct device *dev)
94{
95 return __pm_runtime_idle(dev, RPM_ASYNC);
96}
97
98static inline int pm_request_resume(struct device *dev)
99{
100 return __pm_runtime_resume(dev, RPM_ASYNC);
101}
102
103static inline int pm_request_autosuspend(struct device *dev)
104{
105 return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
106}
107
108static inline int pm_runtime_get(struct device *dev)
109{
110 return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
111}
112
113static inline int pm_runtime_get_sync(struct device *dev)
114{
115 return __pm_runtime_resume(dev, RPM_GET_PUT);
116}
117
118static inline int pm_runtime_put(struct device *dev)
119{
120 return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
121}
122
123static inline int pm_runtime_put_autosuspend(struct device *dev)
124{
125 return __pm_runtime_suspend(dev,
126 RPM_GET_PUT | RPM_ASYNC | RPM_AUTO);
127}
128
129static inline int pm_runtime_put_sync(struct device *dev)
130{
131 return __pm_runtime_idle(dev, RPM_GET_PUT);
132}
133
134static inline int pm_runtime_put_sync_suspend(struct device *dev)
135{
136 return __pm_runtime_suspend(dev, RPM_GET_PUT);
137}
138
139static inline int pm_runtime_put_sync_autosuspend(struct device *dev)
140{
141 return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO);
142}
143
144static inline int pm_runtime_set_active(struct device *dev)
145{
146 return __pm_runtime_set_status(dev, RPM_ACTIVE);
147}
148
149static inline void pm_runtime_set_suspended(struct device *dev)
150{
151 __pm_runtime_set_status(dev, RPM_SUSPENDED);
152}
153
154static inline void pm_runtime_disable(struct device *dev)
155{
156 __pm_runtime_disable(dev, true);
157}
158
159static inline void pm_runtime_use_autosuspend(struct device *dev)
160{
161 __pm_runtime_use_autosuspend(dev, true);
162}
163
164static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
165{
166 __pm_runtime_use_autosuspend(dev, false);
167}
168
169static inline int pm_runtime_get_if_in_use(struct device *dev)
170{
171 return -EINVAL;
172}
173#endif /* _LINUX_PM_RUNTIME_H */
Note: See TracBrowser for help on using the repository browser.