diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 20:22:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 20:22:53 -0500 |
commit | 06a79b82b2a3e4bebb9a20638ca208c780e9e507 (patch) | |
tree | 594a11b60ba56d7ae62f8affa4cd61836e70e4b1 /include | |
parent | 4912002fffa377e66c5caefc2c311732a4ad5fb8 (diff) | |
parent | a9c9b4429df437982d2fbfab1f4b46b01329e9ed (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM / Hibernate: Fix preallocating of memory
PM / Hibernate: Remove swsusp.c finally
PM / Hibernate: Remove trailing space in message
PM: Allow SCSI devices to suspend/resume asynchronously
PM: Allow USB devices to suspend/resume asynchronously
USB: implement non-tree resume ordering constraints for PCI host controllers
PM: Allow PCI devices to suspend/resume asynchronously
PM / Hibernate: Swap, remove useless check from swsusp_read()
PM / Hibernate: Really deprecate deprecated user ioctls
PM: Allow device drivers to use dpm_wait()
PM: Start asynchronous resume threads upfront
PM: Add facility for advanced testing of async suspend/resume
PM: Add a switch for disabling/enabling asynchronous suspend/resume
PM: Asynchronous suspend and resume of devices
PM: Add parent information to timing messages
PM: Document device power attributes in sysfs
PM / Runtime: Add sysfs switch for disabling device run-time PM
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 17 | ||||
-rw-r--r-- | include/linux/pm.h | 6 | ||||
-rw-r--r-- | include/linux/pm_runtime.h | 4 | ||||
-rw-r--r-- | include/linux/resume-trace.h | 7 | ||||
-rw-r--r-- | include/linux/usb.h | 1 |
5 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index a62799f2ab0..b30527db3ac 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -472,6 +472,23 @@ static inline int device_is_registered(struct device *dev) | |||
472 | return dev->kobj.state_in_sysfs; | 472 | return dev->kobj.state_in_sysfs; |
473 | } | 473 | } |
474 | 474 | ||
475 | static inline void device_enable_async_suspend(struct device *dev) | ||
476 | { | ||
477 | if (dev->power.status == DPM_ON) | ||
478 | dev->power.async_suspend = true; | ||
479 | } | ||
480 | |||
481 | static inline void device_disable_async_suspend(struct device *dev) | ||
482 | { | ||
483 | if (dev->power.status == DPM_ON) | ||
484 | dev->power.async_suspend = false; | ||
485 | } | ||
486 | |||
487 | static inline bool device_async_suspend_enabled(struct device *dev) | ||
488 | { | ||
489 | return !!dev->power.async_suspend; | ||
490 | } | ||
491 | |||
475 | void driver_init(void); | 492 | void driver_init(void); |
476 | 493 | ||
477 | /* | 494 | /* |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 198b8f9fe05..e80df06ad22 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
28 | #include <linux/timer.h> | 28 | #include <linux/timer.h> |
29 | #include <linux/completion.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Callbacks for platform drivers to implement. | 32 | * Callbacks for platform drivers to implement. |
@@ -412,9 +413,11 @@ struct dev_pm_info { | |||
412 | pm_message_t power_state; | 413 | pm_message_t power_state; |
413 | unsigned int can_wakeup:1; | 414 | unsigned int can_wakeup:1; |
414 | unsigned int should_wakeup:1; | 415 | unsigned int should_wakeup:1; |
416 | unsigned async_suspend:1; | ||
415 | enum dpm_state status; /* Owned by the PM core */ | 417 | enum dpm_state status; /* Owned by the PM core */ |
416 | #ifdef CONFIG_PM_SLEEP | 418 | #ifdef CONFIG_PM_SLEEP |
417 | struct list_head entry; | 419 | struct list_head entry; |
420 | struct completion completion; | ||
418 | #endif | 421 | #endif |
419 | #ifdef CONFIG_PM_RUNTIME | 422 | #ifdef CONFIG_PM_RUNTIME |
420 | struct timer_list suspend_timer; | 423 | struct timer_list suspend_timer; |
@@ -430,6 +433,7 @@ struct dev_pm_info { | |||
430 | unsigned int request_pending:1; | 433 | unsigned int request_pending:1; |
431 | unsigned int deferred_resume:1; | 434 | unsigned int deferred_resume:1; |
432 | unsigned int run_wake:1; | 435 | unsigned int run_wake:1; |
436 | unsigned int runtime_auto:1; | ||
433 | enum rpm_request request; | 437 | enum rpm_request request; |
434 | enum rpm_status runtime_status; | 438 | enum rpm_status runtime_status; |
435 | int runtime_error; | 439 | int runtime_error; |
@@ -508,6 +512,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
508 | __suspend_report_result(__func__, fn, ret); \ | 512 | __suspend_report_result(__func__, fn, ret); \ |
509 | } while (0) | 513 | } while (0) |
510 | 514 | ||
515 | extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); | ||
511 | #else /* !CONFIG_PM_SLEEP */ | 516 | #else /* !CONFIG_PM_SLEEP */ |
512 | 517 | ||
513 | #define device_pm_lock() do {} while (0) | 518 | #define device_pm_lock() do {} while (0) |
@@ -520,6 +525,7 @@ static inline int dpm_suspend_start(pm_message_t state) | |||
520 | 525 | ||
521 | #define suspend_report_result(fn, ret) do {} while (0) | 526 | #define suspend_report_result(fn, ret) do {} while (0) |
522 | 527 | ||
528 | static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} | ||
523 | #endif /* !CONFIG_PM_SLEEP */ | 529 | #endif /* !CONFIG_PM_SLEEP */ |
524 | 530 | ||
525 | /* How to reorder dpm_list after device_move() */ | 531 | /* How to reorder dpm_list after device_move() */ |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 370ce0a6fe4..7d773aac531 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -28,6 +28,8 @@ extern int __pm_runtime_set_status(struct device *dev, unsigned int status); | |||
28 | extern int pm_runtime_barrier(struct device *dev); | 28 | extern int pm_runtime_barrier(struct device *dev); |
29 | extern void pm_runtime_enable(struct device *dev); | 29 | extern void pm_runtime_enable(struct device *dev); |
30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
31 | extern void pm_runtime_allow(struct device *dev); | ||
32 | extern void pm_runtime_forbid(struct device *dev); | ||
31 | 33 | ||
32 | static inline bool pm_children_suspended(struct device *dev) | 34 | static inline bool pm_children_suspended(struct device *dev) |
33 | { | 35 | { |
@@ -78,6 +80,8 @@ static inline int __pm_runtime_set_status(struct device *dev, | |||
78 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | 80 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } |
79 | static inline void pm_runtime_enable(struct device *dev) {} | 81 | static inline void pm_runtime_enable(struct device *dev) {} |
80 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} | 82 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} |
83 | static inline void pm_runtime_allow(struct device *dev) {} | ||
84 | static inline void pm_runtime_forbid(struct device *dev) {} | ||
81 | 85 | ||
82 | static inline bool pm_children_suspended(struct device *dev) { return false; } | 86 | static inline bool pm_children_suspended(struct device *dev) { return false; } |
83 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | 87 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} |
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h index c9ba2fdf807..bc8c3881c72 100644 --- a/include/linux/resume-trace.h +++ b/include/linux/resume-trace.h | |||
@@ -6,6 +6,11 @@ | |||
6 | 6 | ||
7 | extern int pm_trace_enabled; | 7 | extern int pm_trace_enabled; |
8 | 8 | ||
9 | static inline int pm_trace_is_enabled(void) | ||
10 | { | ||
11 | return pm_trace_enabled; | ||
12 | } | ||
13 | |||
9 | struct device; | 14 | struct device; |
10 | extern void set_trace_device(struct device *); | 15 | extern void set_trace_device(struct device *); |
11 | extern void generate_resume_trace(const void *tracedata, unsigned int user); | 16 | extern void generate_resume_trace(const void *tracedata, unsigned int user); |
@@ -17,6 +22,8 @@ extern void generate_resume_trace(const void *tracedata, unsigned int user); | |||
17 | 22 | ||
18 | #else | 23 | #else |
19 | 24 | ||
25 | static inline int pm_trace_is_enabled(void) { return 0; } | ||
26 | |||
20 | #define TRACE_DEVICE(dev) do { } while (0) | 27 | #define TRACE_DEVICE(dev) do { } while (0) |
21 | #define TRACE_RESUME(dev) do { } while (0) | 28 | #define TRACE_RESUME(dev) do { } while (0) |
22 | 29 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index d7ace1b80f0..332eaea6102 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -339,6 +339,7 @@ struct usb_bus { | |||
339 | 339 | ||
340 | struct usb_devmap devmap; /* device address allocation map */ | 340 | struct usb_devmap devmap; /* device address allocation map */ |
341 | struct usb_device *root_hub; /* Root hub */ | 341 | struct usb_device *root_hub; /* Root hub */ |
342 | struct usb_bus *hs_companion; /* Companion EHCI bus, if any */ | ||
342 | struct list_head bus_list; /* list of busses */ | 343 | struct list_head bus_list; /* list of busses */ |
343 | 344 | ||
344 | int bandwidth_allocated; /* on this bus: how much of the time | 345 | int bandwidth_allocated; /* on this bus: how much of the time |