Subject: [PATCH] [acpi ec] Fill in gpe method for interrupt mode driver - Check if the event expected has happened; wake up delayed process if it has and indicate that the GPE was handled. Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/ec/intr.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) applies-to: 4bdde4db890ef5f5a2929e17eee695da97b63bba 56603dd5f4ef5ee76f9c010ae45fcef83b396372 diff --git a/drivers/acpi/drivers/ec/intr.c b/drivers/acpi/drivers/ec/intr.c index 2cb8781..ea24400 100644 --- a/drivers/acpi/drivers/ec/intr.c +++ b/drivers/acpi/drivers/ec/intr.c @@ -53,9 +53,30 @@ static int wait_intr(struct acpi_ec * ec return -ETIME; } +static int gpe_intr(struct acpi_ec * ec, u32 ec_status) +{ + u32 handled = 0; + + switch (ec->e_expect) { + case ACPI_EC_EVENT_OBF: + if (!(ec_status & ACPI_EC_FLAG_OBF)) + break; + case ACPI_EC_EVENT_IBE: + if (!(ec_status & ACPI_EC_FLAG_IBF)) + break; + ec->e_expect = 0; + wake_up(&ec->e_waitq); + handled = 1; + default: + break; + } + return handled; +} + int ec_intr_init(struct acpi_ec * ec) { ec->e_wait = wait_intr; + ec->e_gpe = gpe_intr; ec->e_gpe_enable = ACPI_ISR; return 0; --- 0.99.9.GIT