Subject: [PATCH] [acpi button] Add event interface for power, sleep, lid buttons Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/button/event.c | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) applies-to: 0b07d5db3dcb188ebecfcd2e7299b4d1d2b5a0f9 91b1e2c9cd8dad9a1bb191b7bf0e331eb4d687b6 diff --git a/drivers/acpi/drivers/button/event.c b/drivers/acpi/drivers/button/event.c index 13139a9..e7fe09a 100644 --- a/drivers/acpi/drivers/button/event.c +++ b/drivers/acpi/drivers/button/event.c @@ -9,4 +9,26 @@ #include #include "button.h" -acpi_device_event_none(button); + +#define ACPI_BUTTON_NOTIFY_STATUS 0x80 + +static void button_notify(acpi_handle handle, u32 event, void *data) +{ + struct acpi_button * ab = data; + + ACPI_FUNCTION_TRACE(FUNCTION); + + switch (event) { + case ACPI_BUTTON_NOTIFY_STATUS: + acpi_bus_generate_event(ab->b_ad->acpi_device, event, + ++ab->b_count); + break; + default: + dbg("Unsupported event [0x%x]\n", event); + break; + } + return_VOID; +} + + +acpi_device_event(button); --- 0.99.9.GIT