Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6.git] / drivers / acpi / ec.c
index 1fa0aaf..f31291b 100644 (file)
@@ -303,11 +303,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);
@@ -316,12 +313,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");
@@ -746,7 +739,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,
@@ -763,7 +756,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;
                }
        }
@@ -774,7 +767,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");
@@ -1018,22 +1011,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,
@@ -1041,8 +1018,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,
                },
 };