diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pm.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index e6b9f29e27d7..3342627e2bd6 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -183,9 +183,9 @@ typedef struct pm_message { | |||
183 | struct dev_pm_info { | 183 | struct dev_pm_info { |
184 | pm_message_t power_state; | 184 | pm_message_t power_state; |
185 | unsigned can_wakeup:1; | 185 | unsigned can_wakeup:1; |
186 | unsigned should_wakeup:1; | ||
186 | bool sleeping:1; /* Owned by the PM core */ | 187 | bool sleeping:1; /* Owned by the PM core */ |
187 | #ifdef CONFIG_PM_SLEEP | 188 | #ifdef CONFIG_PM_SLEEP |
188 | unsigned should_wakeup:1; | ||
189 | struct list_head entry; | 189 | struct list_head entry; |
190 | #endif | 190 | #endif |
191 | }; | 191 | }; |
@@ -198,11 +198,6 @@ extern void device_resume(void); | |||
198 | extern int device_suspend(pm_message_t state); | 198 | extern int device_suspend(pm_message_t state); |
199 | extern int device_prepare_suspend(pm_message_t state); | 199 | extern int device_prepare_suspend(pm_message_t state); |
200 | 200 | ||
201 | #define device_set_wakeup_enable(dev,val) \ | ||
202 | ((dev)->power.should_wakeup = !!(val)) | ||
203 | #define device_may_wakeup(dev) \ | ||
204 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
205 | |||
206 | extern void __suspend_report_result(const char *function, void *fn, int ret); | 201 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
207 | 202 | ||
208 | #define suspend_report_result(fn, ret) \ | 203 | #define suspend_report_result(fn, ret) \ |
@@ -210,6 +205,24 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
210 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 205 | __suspend_report_result(__FUNCTION__, fn, ret); \ |
211 | } while (0) | 206 | } while (0) |
212 | 207 | ||
208 | #else /* !CONFIG_PM_SLEEP */ | ||
209 | |||
210 | static inline int device_suspend(pm_message_t state) | ||
211 | { | ||
212 | return 0; | ||
213 | } | ||
214 | |||
215 | #define suspend_report_result(fn, ret) do { } while (0) | ||
216 | |||
217 | #endif /* !CONFIG_PM_SLEEP */ | ||
218 | |||
219 | #ifdef CONFIG_PM | ||
220 | |||
221 | #define device_set_wakeup_enable(dev,val) \ | ||
222 | ((dev)->power.should_wakeup = !!(val)) | ||
223 | #define device_may_wakeup(dev) \ | ||
224 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
225 | |||
213 | /* | 226 | /* |
214 | * Platform hook to activate device wakeup capability, if that's not already | 227 | * Platform hook to activate device wakeup capability, if that's not already |
215 | * handled by enable_irq_wake() etc. | 228 | * handled by enable_irq_wake() etc. |
@@ -224,24 +237,17 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | |||
224 | return 0; | 237 | return 0; |
225 | } | 238 | } |
226 | 239 | ||
227 | #else /* !CONFIG_PM_SLEEP */ | 240 | #else /* !CONFIG_PM */ |
228 | |||
229 | static inline int device_suspend(pm_message_t state) | ||
230 | { | ||
231 | return 0; | ||
232 | } | ||
233 | 241 | ||
234 | #define device_set_wakeup_enable(dev,val) do{}while(0) | 242 | #define device_set_wakeup_enable(dev,val) do{}while(0) |
235 | #define device_may_wakeup(dev) (0) | 243 | #define device_may_wakeup(dev) (0) |
236 | 244 | ||
237 | #define suspend_report_result(fn, ret) do { } while (0) | ||
238 | |||
239 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | 245 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) |
240 | { | 246 | { |
241 | return 0; | 247 | return 0; |
242 | } | 248 | } |
243 | 249 | ||
244 | #endif /* !CONFIG_PM_SLEEP */ | 250 | #endif /* !CONFIG_PM */ |
245 | 251 | ||
246 | /* changes to device_may_wakeup take effect on the next pm state change. | 252 | /* changes to device_may_wakeup take effect on the next pm state change. |
247 | * by default, devices should wakeup if they can. | 253 | * by default, devices should wakeup if they can. |