aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-05-10 00:08:43 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-29 21:20:23 +0200
commitc10d7a13846bffa5c77f1122500b687ab902e2d2 (patch)
tree0ccc77e7931cb6bda11cc4d24caaebf5aea28246 /drivers/acpi/scan.c
parentLinux 3.4 (diff)
downloadlinux-dev-c10d7a13846bffa5c77f1122500b687ab902e2d2.tar.xz
linux-dev-c10d7a13846bffa5c77f1122500b687ab902e2d2.zip
ACPI / PM: Generate wakeup events on fixed power button
When the system is woken up by the ACPI fixed power button, currently there is no way of userspace becoming aware that the power button was pressed. OLPC would like to know this, so that we can respond appropriately. For example, if the system was woken up by a network packet, we know we can go back to sleep very quickly. But if the user explicitly woke the system with the power button, we're going to want to stay awake for a while. The wakeup count mechanism seems like a good fit for communicating this. Mark the fixed power button as wakeup-enabled, and increment its wakeup counter when the system is woken with the power button. (The wakeup counter is also incremented when the power button is pressed during system operation; this is already handled by an existing acpi-button codepath). Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 85cbfdccc97c..c8a1f3b68110 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1567,6 +1567,7 @@ static int acpi_bus_scan_fixed(void)
ACPI_BUS_TYPE_POWER_BUTTON,
ACPI_STA_DEFAULT,
&ops);
+ device_init_wakeup(&device->dev, true);
}
if ((acpi_gbl_FADT.flags & ACPI_FADT_SLEEP_BUTTON) == 0) {