aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-10-31 13:51:57 -0500
committerTony Luck <tony.luck@intel.com>2005-10-31 13:51:57 -0500
commitc7fb577e2a6cb04732541f2dc402bd46747f7558 (patch)
treedf3b1a1922ed13bfbcc45d08650c38beeb1a7bd1 /include/linux/pm.h
parent9cec58dc138d6fcad9f447a19c8ff69f6540e667 (diff)
parent581c1b14394aee60aff46ea67d05483261ed6527 (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.h41
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
171struct pm_ops { 171struct 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
220struct dev_pm_info { 221struct 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
238extern int device_suspend(pm_message_t state); 240extern 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
247extern int dpm_runtime_suspend(struct device *, pm_message_t);
248extern void dpm_runtime_resume(struct device *);
249
250#else /* !CONFIG_PM */
251
240static inline int device_suspend(pm_message_t state) 252static 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
260static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
261{
262 return 0;
263}
264
265static 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 */