From a44061aa8b5d58b2729faca4c155a94a5bea2a09 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 1 Jul 2010 10:11:45 +0800 Subject: ACPICA: Remove wakeup GPE reference counting which is not used After the previous patch that introduced acpi_gpe_wakeup() and modified the ACPI suspend and wakeup code to use it, the third argument of acpi_{enable|disable}_gpe() and the GPE wakeup reference counter are not necessary any more. Remove them and modify all of the users of acpi_{enable|disable}_gpe() accordingly. Also drop GPE type constants that aren't used any more. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- drivers/acpi/ec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/acpi/ec.c') diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 5f2027d782e..bf504541657 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -822,7 +822,7 @@ static int ec_install_handlers(struct acpi_ec *ec) if (ACPI_FAILURE(status)) return -ENODEV; - acpi_enable_gpe(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); + acpi_enable_gpe(NULL, ec->gpe); status = acpi_install_address_space_handler(ec->handle, ACPI_ADR_SPACE_EC, &acpi_ec_space_handler, @@ -839,7 +839,7 @@ static int ec_install_handlers(struct acpi_ec *ec) } else { acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); - acpi_disable_gpe(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); + acpi_disable_gpe(NULL, ec->gpe); return -ENODEV; } } @@ -850,7 +850,7 @@ static int ec_install_handlers(struct acpi_ec *ec) static void ec_remove_handlers(struct acpi_ec *ec) { - acpi_disable_gpe(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); + acpi_disable_gpe(NULL, ec->gpe); if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) pr_err(PREFIX "failed to remove space handler\n"); -- cgit v1.2.3 From b63559f5ce08bc8f94ce144a8d06f7af607ecc53 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 25 Jun 2010 01:20:38 +0200 Subject: ACPI / EC: Drop suspend and resume routines The suspend and resume routines provided by the EC driver are not really necessary, because the handler of the GPE disabled by them is not going to be executed after suspend_device_irqs() and before resume_device_irqs() anyway. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- drivers/acpi/ec.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'drivers/acpi/ec.c') diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index bf504541657..9bf7a7546bd 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1088,22 +1088,6 @@ error: return -ENODEV; } -static int acpi_ec_suspend(struct acpi_device *device, pm_message_t state) -{ - struct acpi_ec *ec = acpi_driver_data(device); - /* Stop using the GPE, but keep it reference counted. */ - acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE); - return 0; -} - -static int acpi_ec_resume(struct acpi_device *device) -{ - struct acpi_ec *ec = acpi_driver_data(device); - /* Enable the GPE again, but don't reference count it once more. */ - acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE); - return 0; -} - static struct acpi_driver acpi_ec_driver = { .name = "ec", .class = ACPI_EC_CLASS, @@ -1111,8 +1095,6 @@ static struct acpi_driver acpi_ec_driver = { .ops = { .add = acpi_ec_add, .remove = acpi_ec_remove, - .suspend = acpi_ec_suspend, - .resume = acpi_ec_resume, }, }; -- cgit v1.2.3 From 3784730b02b9f147a55b0e4623fcad671273e6e6 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 25 Jun 2010 01:21:42 +0200 Subject: ACPI / EC: Do not use acpi_set_gpe The EC driver is the last user of acpi_set_gpe() and since it is guaranteed that the EC GPE will not be shared, acpi_disable_gpe() and acpi_enable_gpe() may be used for disabling the GPE temporarilty if a GPE storm is detected and re-enabling it during EC transactions. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- drivers/acpi/ec.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'drivers/acpi/ec.c') diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 9bf7a7546bd..1e6d4184f0e 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -313,11 +313,8 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) pr_debug(PREFIX "transaction start\n"); /* disable GPE during transaction if storm is detected */ if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) { - /* - * It has to be disabled at the hardware level regardless of the - * GPE reference counting, so that it doesn't trigger. - */ - acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE); + /* It has to be disabled, so that it doesn't trigger. */ + acpi_disable_gpe(NULL, ec->gpe); } status = acpi_ec_transaction_unlocked(ec, t); @@ -326,12 +323,8 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) ec_check_sci_sync(ec, acpi_ec_read_status(ec)); if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) { msleep(1); - /* - * It is safe to enable the GPE outside of the transaction. Use - * acpi_set_gpe() for that, since we used it to disable the GPE - * above. - */ - acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE); + /* It is safe to enable the GPE outside of the transaction. */ + acpi_enable_gpe(NULL, ec->gpe); } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) { pr_info(PREFIX "GPE storm detected, " "transactions will use polling mode\n"); -- cgit v1.2.3