aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-06-13 00:36:52 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2010-07-19 01:58:48 +0200
commit2430d12c94ff2bafcfe4f65edf7ee5f300d2d9c6 (patch)
treea904bbe41d973bca7079ea6b9ffd42e080a7798d
parent90133673395849c9d4e66a563f2d0d91d92aa461 (diff)
downloadlinux-linaro-stable-2430d12c94ff2bafcfe4f65edf7ee5f300d2d9c6.tar.gz
PM: describe kernel policy regarding wakeup defaults (v. 2)
This patch (as1381b) updates a comment describing the kernel's policy toward enabling wakeup by default. It also makes device_set_wakeup_capable() actually do something when CONFIG_PM isn't enabled. It's not clear this is necessary; however if it isn't then device_init_wakeup() and device_can_wakeup() should also be do-nothing routines. Furthermore, I don't expect this change to have any noticeable effect -- but if it does then clearly the old behavior was wrong. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--include/linux/pm_wakeup.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index 22d64c18056c..76aca48722ae 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -29,8 +29,11 @@
#ifdef CONFIG_PM
-/* changes to device_may_wakeup take effect on the next pm state change.
- * by default, devices should wakeup if they can.
+/* Changes to device_may_wakeup take effect on the next pm state change.
+ *
+ * By default, most devices should leave wakeup disabled. The exceptions
+ * are devices that everyone expects to be wakeup sources: keyboards,
+ * power buttons, possibly network interfaces, etc.
*/
static inline void device_init_wakeup(struct device *dev, bool val)
{
@@ -59,7 +62,7 @@ static inline bool device_may_wakeup(struct device *dev)
#else /* !CONFIG_PM */
-/* For some reason the next two routines work even without CONFIG_PM */
+/* For some reason the following routines work even without CONFIG_PM */
static inline void device_init_wakeup(struct device *dev, bool val)
{
dev->power.can_wakeup = val;
@@ -67,6 +70,7 @@ static inline void device_init_wakeup(struct device *dev, bool val)
static inline void device_set_wakeup_capable(struct device *dev, bool capable)
{
+ dev->power.can_wakeup = capable;
}
static inline bool device_can_wakeup(struct device *dev)