diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 01:58:41 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 01:58:41 -0500 |
commit | fce45c1c8a6b5334fa88bbb9b1496b0699d3fef0 (patch) | |
tree | cba2597077cf33d122f8d771bf84618cc5374cf6 /include/linux/pm.h | |
parent | 15dbb5a3f971a28040ae6cbcd8bbdf19b629fa83 (diff) | |
parent | 81cfb8864c73230eb1c37753aba517db15cf4d8f (diff) |
Merge branch 'upstream'
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5cfb07648eca..c61d5de837ef 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -219,10 +219,11 @@ typedef struct pm_message { | |||
219 | 219 | ||
220 | struct dev_pm_info { | 220 | struct dev_pm_info { |
221 | pm_message_t power_state; | 221 | pm_message_t power_state; |
222 | unsigned can_wakeup:1; | ||
222 | #ifdef CONFIG_PM | 223 | #ifdef CONFIG_PM |
224 | unsigned should_wakeup:1; | ||
223 | pm_message_t prev_state; | 225 | pm_message_t prev_state; |
224 | void * saved_state; | 226 | void * saved_state; |
225 | atomic_t pm_users; | ||
226 | struct device * pm_parent; | 227 | struct device * pm_parent; |
227 | struct list_head entry; | 228 | struct list_head entry; |
228 | #endif | 229 | #endif |
@@ -236,13 +237,48 @@ extern void device_resume(void); | |||
236 | 237 | ||
237 | #ifdef CONFIG_PM | 238 | #ifdef CONFIG_PM |
238 | extern int device_suspend(pm_message_t state); | 239 | extern int device_suspend(pm_message_t state); |
239 | #else | 240 | |
241 | #define device_set_wakeup_enable(dev,val) \ | ||
242 | ((dev)->power.should_wakeup = !!(val)) | ||
243 | #define device_may_wakeup(dev) \ | ||
244 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
245 | |||
246 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | ||
247 | extern void dpm_runtime_resume(struct device *); | ||
248 | |||
249 | #else /* !CONFIG_PM */ | ||
250 | |||
240 | static inline int device_suspend(pm_message_t state) | 251 | static inline int device_suspend(pm_message_t state) |
241 | { | 252 | { |
242 | return 0; | 253 | return 0; |
243 | } | 254 | } |
255 | |||
256 | #define device_set_wakeup_enable(dev,val) do{}while(0) | ||
257 | #define device_may_wakeup(dev) (0) | ||
258 | |||
259 | static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | ||
260 | { | ||
261 | return 0; | ||
262 | } | ||
263 | |||
264 | static inline void dpm_runtime_resume(struct device * dev) | ||
265 | { | ||
266 | |||
267 | } | ||
268 | |||
244 | #endif | 269 | #endif |
245 | 270 | ||
271 | /* changes to device_may_wakeup take effect on the next pm state change. | ||
272 | * by default, devices should wakeup if they can. | ||
273 | */ | ||
274 | #define device_can_wakeup(dev) \ | ||
275 | ((dev)->power.can_wakeup) | ||
276 | #define device_init_wakeup(dev,val) \ | ||
277 | do { \ | ||
278 | device_can_wakeup(dev) = !!(val); \ | ||
279 | device_set_wakeup_enable(dev,val); \ | ||
280 | } while(0) | ||
281 | |||
246 | #endif /* __KERNEL__ */ | 282 | #endif /* __KERNEL__ */ |
247 | 283 | ||
248 | #endif /* _LINUX_PM_H */ | 284 | #endif /* _LINUX_PM_H */ |