]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / PM: Generate wakeup events on fixed power button
authorDaniel Drake <dsd@laptop.org>
Wed, 9 May 2012 23:08:43 +0000 (00:08 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 29 May 2012 19:20:23 +0000 (21:20 +0200)
commitc10d7a13846bffa5c77f1122500b687ab902e2d2
tree0ccc77e7931cb6bda11cc4d24caaebf5aea28246
parent76e10d158efb6d4516018846f60c2ab5501900bc
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>
drivers/acpi/scan.c
drivers/acpi/sleep.c