aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/power/runtime_pm.txt7
-rw-r--r--include/linux/pm.h8
-rw-r--r--include/linux/pm_runtime.h12
3 files changed, 22 insertions, 5 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 6bb25cb24da9..4a3109b28847 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -71,9 +71,9 @@ what to do to handle the device).
71 purpose). 71 purpose).
72 72
73In particular, if the driver requires remote wakeup capability for proper 73In particular, if the driver requires remote wakeup capability for proper
74functioning and device_may_wakeup() returns 'false' for the device, then 74functioning and device_run_wake() returns 'false' for the device, then
75->runtime_suspend() should return -EBUSY. On the other hand, if 75->runtime_suspend() should return -EBUSY. On the other hand, if
76device_may_wakeup() returns 'true' for the device and the device is put 76device_run_wake() returns 'true' for the device and the device is put
77into a low power state during the execution of its bus type's 77into a low power state during the execution of its bus type's
78->runtime_suspend(), it is expected that remote wake-up (i.e. hardware mechanism 78->runtime_suspend(), it is expected that remote wake-up (i.e. hardware mechanism
79allowing the device to request a change of its power state, such as PCI PME) 79allowing the device to request a change of its power state, such as PCI PME)
@@ -215,6 +215,9 @@ defined in include/linux/pm.h:
215 being executed for that device and it is not practical to wait for the 215 being executed for that device and it is not practical to wait for the
216 suspend to complete; means "start a resume as soon as you've suspended" 216 suspend to complete; means "start a resume as soon as you've suspended"
217 217
218 unsigned int run_wake;
219 - set if the device is capable of generating run-time wake-up events
220
218 enum rpm_status runtime_status; 221 enum rpm_status runtime_status;
219 - the run-time PM status of the device; this field's initial value is 222 - the run-time PM status of the device; this field's initial value is
220 RPM_SUSPENDED, which means that each device is initially regarded by the 223 RPM_SUSPENDED, which means that each device is initially regarded by the
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
53static inline bool device_run_wake(struct device *dev)
54{
55 return dev->power.run_wake;
56}
57
58static 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
55static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } 65static 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; }
73static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} 83static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
74static inline void pm_runtime_get_noresume(struct device *dev) {} 84static inline void pm_runtime_get_noresume(struct device *dev) {}
75static inline void pm_runtime_put_noidle(struct device *dev) {} 85static inline void pm_runtime_put_noidle(struct device *dev) {}
86static inline bool device_run_wake(struct device *dev) { return false; }
87static 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