Subject: [PATCH] [acpi ec] Add ->e_gpe() method to struct acpi_ec - Called from gpe_callback(), if it is set - Passed the ec device, and the ec status after GPE fired - Should return 1 or 0, if handled or not Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/ec/ec.h | 1 + drivers/acpi/drivers/ec/gpe.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-) applies-to: e13c049a8ad27263c332ae2fe5946d7f0b4fdc40 a64021f07982ddad981138ef77708f1d2237e15e diff --git a/drivers/acpi/drivers/ec/ec.h b/drivers/acpi/drivers/ec/ec.h index 00307e3..a5ca5a6 100644 --- a/drivers/acpi/drivers/ec/ec.h +++ b/drivers/acpi/drivers/ec/ec.h @@ -54,6 +54,7 @@ struct acpi_ec { int e_gpe_enable; int (*e_wait) (struct acpi_ec * ec, u32 event); + int (*e_gpe) (struct acpi_ec * ec, u32 status); }; diff --git a/drivers/acpi/drivers/ec/gpe.c b/drivers/acpi/drivers/ec/gpe.c index 86615d6..2fae739 100644 --- a/drivers/acpi/drivers/ec/gpe.c +++ b/drivers/acpi/drivers/ec/gpe.c @@ -87,6 +87,12 @@ static u32 gpe_callback(void * data) acpi_disable_gpe(NULL, ec->e_gpe_bit, ACPI_ISR); ec_status = ec_read_status(ec); + if (ec->e_gpe) { + int ret = ec->e_gpe(ec, ec_status); + if (ret) + return ACPI_INTERRUPT_HANDLED; + } + /* * NOTE: All we care about are EC-SCI's. Other EC events are * handled via polling (yuck!). This is because some systems --- 0.99.9.GIT