PM: Do not create wakeup sysfs files for devices that cannot wake up
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 8 Feb 2011 22:26:02 +0000 (23:26 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Mon, 14 Mar 2011 23:43:14 +0000 (00:43 +0100)
commitcb8f51bdadb7969139c2e39c2defd4cde98c1ea8
treea6d6e20878460d50b8f61d5fe3237818c54065eb
parent4681b17154b3fd81f898802262985f662344e6ed
PM: Do not create wakeup sysfs files for devices that cannot wake up

Currently, wakeup sysfs attributes are created for all devices,
regardless of whether or not they are wakeup-capable.  This is
excessive and complicates wakeup device identification from user
space (i.e. to identify wakeup-capable devices user space has to read
/sys/devices/.../power/wakeup for all devices and see if they are not
empty).

Fix this issue by avoiding to create wakeup sysfs files for devices
that cannot wake up the system from sleep states (i.e. whose
power.can_wakeup flags are unset during registration) and modify
device_set_wakeup_capable() so that it adds (or removes) the relevant
sysfs attributes if a device's wakeup capability status is changed.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Documentation/ABI/testing/sysfs-devices-power
Documentation/power/devices.txt
drivers/base/power/power.h
drivers/base/power/sysfs.c
drivers/base/power/wakeup.c
include/linux/pm_runtime.h
include/linux/pm_wakeup.h