diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-12-03 15:19:18 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-12-06 10:17:57 -0500 |
commit | 7a1a8eb58a2c6cd819d17332c5a2c369203635d5 (patch) | |
tree | 2424ca8b41f97a0d4110218ef75caa50270c194a /include/linux | |
parent | 965c4ac0613b071d6f035334c5d9d942013df4f9 (diff) |
PM: Add flag for devices capable of generating run-time wake-up events
Apparently, there are devices that can wake up the system from sleep
states and yet are incapable of generating wake-up events at run
time. Thus, introduce a flag indicating if given device is capable
of generating run-time wake-up events.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/pm.h | 8 | ||||
-rw-r--r-- | include/linux/pm_runtime.h | 12 |
2 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 3b7e04b95bd2..0d65934246af 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -178,9 +178,10 @@ typedef struct pm_message { | |||
178 | * This need not mean that the device should be put into a low power state. | 178 | * This need not mean that the device should be put into a low power state. |
179 | * For example, if the device is behind a link which is about to be turned | 179 | * For example, if the device is behind a link which is about to be turned |
180 | * off, the device may remain at full power. If the device does go to low | 180 | * off, the device may remain at full power. If the device does go to low |
181 | * power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a | 181 | * power and is capable of generating run-time wake-up events, remote |
182 | * hardware mechanism allowing the device to request a change of its power | 182 | * wake-up (i.e., a hardware mechanism allowing the device to request a |
183 | * state, such as PCI PME) should be enabled for it. | 183 | * change of its power state via a wake-up event, such as PCI PME) should |
184 | * be enabled for it. | ||
184 | * | 185 | * |
185 | * @runtime_resume: Put the device into the fully active state in response to a | 186 | * @runtime_resume: Put the device into the fully active state in response to a |
186 | * wake-up event generated by hardware or at the request of software. If | 187 | * wake-up event generated by hardware or at the request of software. If |
@@ -428,6 +429,7 @@ struct dev_pm_info { | |||
428 | unsigned int idle_notification:1; | 429 | unsigned int idle_notification:1; |
429 | unsigned int request_pending:1; | 430 | unsigned int request_pending:1; |
430 | unsigned int deferred_resume:1; | 431 | unsigned int deferred_resume:1; |
432 | unsigned int run_wake:1; | ||
431 | enum rpm_request request; | 433 | enum rpm_request request; |
432 | enum rpm_status runtime_status; | 434 | enum rpm_status runtime_status; |
433 | int runtime_error; | 435 | int runtime_error; |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 44087044910f..370ce0a6fe4a 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -50,6 +50,16 @@ static inline void pm_runtime_put_noidle(struct device *dev) | |||
50 | atomic_add_unless(&dev->power.usage_count, -1, 0); | 50 | atomic_add_unless(&dev->power.usage_count, -1, 0); |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline bool device_run_wake(struct device *dev) | ||
54 | { | ||
55 | return dev->power.run_wake; | ||
56 | } | ||
57 | |||
58 | static inline void device_set_run_wake(struct device *dev, bool enable) | ||
59 | { | ||
60 | dev->power.run_wake = enable; | ||
61 | } | ||
62 | |||
53 | #else /* !CONFIG_PM_RUNTIME */ | 63 | #else /* !CONFIG_PM_RUNTIME */ |
54 | 64 | ||
55 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } | 65 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } |
@@ -73,6 +83,8 @@ static inline bool pm_children_suspended(struct device *dev) { return false; } | |||
73 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | 83 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} |
74 | static inline void pm_runtime_get_noresume(struct device *dev) {} | 84 | static inline void pm_runtime_get_noresume(struct device *dev) {} |
75 | static inline void pm_runtime_put_noidle(struct device *dev) {} | 85 | static inline void pm_runtime_put_noidle(struct device *dev) {} |
86 | static inline bool device_run_wake(struct device *dev) { return false; } | ||
87 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | ||
76 | 88 | ||
77 | #endif /* !CONFIG_PM_RUNTIME */ | 89 | #endif /* !CONFIG_PM_RUNTIME */ |
78 | 90 | ||