diff options
author | Tony Luck <tony.luck@intel.com> | 2005-10-31 13:51:57 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-10-31 13:51:57 -0500 |
commit | c7fb577e2a6cb04732541f2dc402bd46747f7558 (patch) | |
tree | df3b1a1922ed13bfbcc45d08650c38beeb1a7bd1 /include/linux/pm.h | |
parent | 9cec58dc138d6fcad9f447a19c8ff69f6540e667 (diff) | |
parent | 581c1b14394aee60aff46ea67d05483261ed6527 (diff) |
manual update from upstream:
Applied Al's change 06a544971fad0992fe8b92c5647538d573089dd4
to new location of swiotlb.c
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5cfb07648eca..1514098d156d 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -170,6 +170,7 @@ typedef int __bitwise suspend_disk_method_t; | |||
170 | 170 | ||
171 | struct pm_ops { | 171 | struct pm_ops { |
172 | suspend_disk_method_t pm_disk_mode; | 172 | suspend_disk_method_t pm_disk_mode; |
173 | int (*valid)(suspend_state_t state); | ||
173 | int (*prepare)(suspend_state_t state); | 174 | int (*prepare)(suspend_state_t state); |
174 | int (*enter)(suspend_state_t state); | 175 | int (*enter)(suspend_state_t state); |
175 | int (*finish)(suspend_state_t state); | 176 | int (*finish)(suspend_state_t state); |
@@ -219,10 +220,11 @@ typedef struct pm_message { | |||
219 | 220 | ||
220 | struct dev_pm_info { | 221 | struct dev_pm_info { |
221 | pm_message_t power_state; | 222 | pm_message_t power_state; |
223 | unsigned can_wakeup:1; | ||
222 | #ifdef CONFIG_PM | 224 | #ifdef CONFIG_PM |
225 | unsigned should_wakeup:1; | ||
223 | pm_message_t prev_state; | 226 | pm_message_t prev_state; |
224 | void * saved_state; | 227 | void * saved_state; |
225 | atomic_t pm_users; | ||
226 | struct device * pm_parent; | 228 | struct device * pm_parent; |
227 | struct list_head entry; | 229 | struct list_head entry; |
228 | #endif | 230 | #endif |
@@ -236,13 +238,48 @@ extern void device_resume(void); | |||
236 | 238 | ||
237 | #ifdef CONFIG_PM | 239 | #ifdef CONFIG_PM |
238 | extern int device_suspend(pm_message_t state); | 240 | extern int device_suspend(pm_message_t state); |
239 | #else | 241 | |
242 | #define device_set_wakeup_enable(dev,val) \ | ||
243 | ((dev)->power.should_wakeup = !!(val)) | ||
244 | #define device_may_wakeup(dev) \ | ||
245 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
246 | |||
247 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | ||
248 | extern void dpm_runtime_resume(struct device *); | ||
249 | |||
250 | #else /* !CONFIG_PM */ | ||
251 | |||
240 | static inline int device_suspend(pm_message_t state) | 252 | static inline int device_suspend(pm_message_t state) |
241 | { | 253 | { |
242 | return 0; | 254 | return 0; |
243 | } | 255 | } |
256 | |||
257 | #define device_set_wakeup_enable(dev,val) do{}while(0) | ||
258 | #define device_may_wakeup(dev) (0) | ||
259 | |||
260 | static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | ||
261 | { | ||
262 | return 0; | ||
263 | } | ||
264 | |||
265 | static inline void dpm_runtime_resume(struct device * dev) | ||
266 | { | ||
267 | |||
268 | } | ||
269 | |||
244 | #endif | 270 | #endif |
245 | 271 | ||
272 | /* changes to device_may_wakeup take effect on the next pm state change. | ||
273 | * by default, devices should wakeup if they can. | ||
274 | */ | ||
275 | #define device_can_wakeup(dev) \ | ||
276 | ((dev)->power.can_wakeup) | ||
277 | #define device_init_wakeup(dev,val) \ | ||
278 | do { \ | ||
279 | device_can_wakeup(dev) = !!(val); \ | ||
280 | device_set_wakeup_enable(dev,val); \ | ||
281 | } while(0) | ||
282 | |||
246 | #endif /* __KERNEL__ */ | 283 | #endif /* __KERNEL__ */ |
247 | 284 | ||
248 | #endif /* _LINUX_PM_H */ | 285 | #endif /* _LINUX_PM_H */ |