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 |
|
---|
15 | static inline bool pm_runtime_active(struct device *dev) { return true; }
|
---|
16 |
|
---|
17 | static inline bool queue_pm_work(struct work_struct *work) { return false; }
|
---|
18 |
|
---|
19 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
|
---|
20 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
|
---|
21 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
|
---|
22 | static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
|
---|
23 |
|
---|
24 | static inline int __pm_runtime_idle(struct device *dev, int rpmflags)
|
---|
25 | {
|
---|
26 | return -ENOSYS;
|
---|
27 | }
|
---|
28 | static inline int __pm_runtime_suspend(struct device *dev, int rpmflags)
|
---|
29 | {
|
---|
30 | return -ENOSYS;
|
---|
31 | }
|
---|
32 | static inline int __pm_runtime_resume(struct device *dev, int rpmflags)
|
---|
33 | {
|
---|
34 | return 1;
|
---|
35 | }
|
---|
36 | static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
|
---|
37 | {
|
---|
38 | return -ENOSYS;
|
---|
39 | }
|
---|
40 | static inline int __pm_runtime_set_status(struct device *dev,
|
---|
41 | unsigned int status) { return 0; }
|
---|
42 | static inline int pm_runtime_barrier(struct device *dev) { return 0; }
|
---|
43 | static inline void pm_runtime_enable(struct device *dev) {}
|
---|
44 | static inline void __pm_runtime_disable(struct device *dev, bool c) {}
|
---|
45 | static inline void pm_runtime_allow(struct device *dev) {}
|
---|
46 | static inline void pm_runtime_forbid(struct device *dev) {}
|
---|
47 |
|
---|
48 | static inline bool pm_children_suspended(struct device *dev) { return false; }
|
---|
49 | static inline void pm_runtime_get_noresume(struct device *dev) {}
|
---|
50 | static inline void pm_runtime_put_noidle(struct device *dev) {}
|
---|
51 | static inline bool device_run_wake(struct device *dev) { return false; }
|
---|
52 | static inline void device_set_run_wake(struct device *dev, bool enable) {}
|
---|
53 | static inline bool pm_runtime_suspended(struct device *dev) { return false; }
|
---|
54 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
|
---|
55 | static inline bool pm_runtime_suspended_if_enabled(struct device *dev) { return false; }
|
---|
56 | static inline bool pm_runtime_enabled(struct device *dev) { return false; }
|
---|
57 |
|
---|
58 | static inline void pm_runtime_no_callbacks(struct device *dev) {}
|
---|
59 | static inline void pm_runtime_irq_safe(struct device *dev) {}
|
---|
60 | static inline bool pm_runtime_is_irq_safe(struct device *dev) { return false; }
|
---|
61 |
|
---|
62 | static inline bool pm_runtime_callbacks_present(struct device *dev) { return false; }
|
---|
63 | static inline void pm_runtime_mark_last_busy(struct device *dev) {}
|
---|
64 | static inline void __pm_runtime_use_autosuspend(struct device *dev,
|
---|
65 | bool use) {}
|
---|
66 | static inline void pm_runtime_set_autosuspend_delay(struct device *dev,
|
---|
67 | int delay) {}
|
---|
68 | static inline unsigned long pm_runtime_autosuspend_expiration(
|
---|
69 | struct device *dev) { return 0; }
|
---|
70 | static inline void pm_runtime_set_memalloc_noio(struct device *dev,
|
---|
71 | bool enable){}
|
---|
72 |
|
---|
73 | static inline int pm_runtime_idle(struct device *dev)
|
---|
74 | {
|
---|
75 | return __pm_runtime_idle(dev, 0);
|
---|
76 | }
|
---|
77 |
|
---|
78 | static inline int pm_runtime_suspend(struct device *dev)
|
---|
79 | {
|
---|
80 | return __pm_runtime_suspend(dev, 0);
|
---|
81 | }
|
---|
82 |
|
---|
83 | static inline int pm_runtime_autosuspend(struct device *dev)
|
---|
84 | {
|
---|
85 | return __pm_runtime_suspend(dev, RPM_AUTO);
|
---|
86 | }
|
---|
87 |
|
---|
88 | static inline int pm_runtime_resume(struct device *dev)
|
---|
89 | {
|
---|
90 | return __pm_runtime_resume(dev, 0);
|
---|
91 | }
|
---|
92 |
|
---|
93 | static inline int pm_request_idle(struct device *dev)
|
---|
94 | {
|
---|
95 | return __pm_runtime_idle(dev, RPM_ASYNC);
|
---|
96 | }
|
---|
97 |
|
---|
98 | static inline int pm_request_resume(struct device *dev)
|
---|
99 | {
|
---|
100 | return __pm_runtime_resume(dev, RPM_ASYNC);
|
---|
101 | }
|
---|
102 |
|
---|
103 | static inline int pm_request_autosuspend(struct device *dev)
|
---|
104 | {
|
---|
105 | return __pm_runtime_suspend(dev, RPM_ASYNC | RPM_AUTO);
|
---|
106 | }
|
---|
107 |
|
---|
108 | static inline int pm_runtime_get(struct device *dev)
|
---|
109 | {
|
---|
110 | return __pm_runtime_resume(dev, RPM_GET_PUT | RPM_ASYNC);
|
---|
111 | }
|
---|
112 |
|
---|
113 | static inline int pm_runtime_get_sync(struct device *dev)
|
---|
114 | {
|
---|
115 | return __pm_runtime_resume(dev, RPM_GET_PUT);
|
---|
116 | }
|
---|
117 |
|
---|
118 | static inline int pm_runtime_put(struct device *dev)
|
---|
119 | {
|
---|
120 | return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
|
---|
121 | }
|
---|
122 |
|
---|
123 | static 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 |
|
---|
129 | static inline int pm_runtime_put_sync(struct device *dev)
|
---|
130 | {
|
---|
131 | return __pm_runtime_idle(dev, RPM_GET_PUT);
|
---|
132 | }
|
---|
133 |
|
---|
134 | static inline int pm_runtime_put_sync_suspend(struct device *dev)
|
---|
135 | {
|
---|
136 | return __pm_runtime_suspend(dev, RPM_GET_PUT);
|
---|
137 | }
|
---|
138 |
|
---|
139 | static inline int pm_runtime_put_sync_autosuspend(struct device *dev)
|
---|
140 | {
|
---|
141 | return __pm_runtime_suspend(dev, RPM_GET_PUT | RPM_AUTO);
|
---|
142 | }
|
---|
143 |
|
---|
144 | static inline int pm_runtime_set_active(struct device *dev)
|
---|
145 | {
|
---|
146 | return __pm_runtime_set_status(dev, RPM_ACTIVE);
|
---|
147 | }
|
---|
148 |
|
---|
149 | static inline void pm_runtime_set_suspended(struct device *dev)
|
---|
150 | {
|
---|
151 | __pm_runtime_set_status(dev, RPM_SUSPENDED);
|
---|
152 | }
|
---|
153 |
|
---|
154 | static inline void pm_runtime_disable(struct device *dev)
|
---|
155 | {
|
---|
156 | __pm_runtime_disable(dev, true);
|
---|
157 | }
|
---|
158 |
|
---|
159 | static inline void pm_runtime_use_autosuspend(struct device *dev)
|
---|
160 | {
|
---|
161 | __pm_runtime_use_autosuspend(dev, true);
|
---|
162 | }
|
---|
163 |
|
---|
164 | static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
|
---|
165 | {
|
---|
166 | __pm_runtime_use_autosuspend(dev, false);
|
---|
167 | }
|
---|
168 |
|
---|
169 | static inline int pm_runtime_get_if_in_use(struct device *dev)
|
---|
170 | {
|
---|
171 | return -EINVAL;
|
---|
172 | }
|
---|
173 | #endif /* _LINUX_PM_RUNTIME_H */
|
---|