ACPICA: Introduce acpi_enable_all_wakeup_gpes()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 30 Sep 2014 00:25:42 +0000 (02:25 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 30 Sep 2014 19:04:47 +0000 (21:04 +0200)
Add a routine for host OSes to enable all wakeup GPEs and disable
all of the non-wakeup ones at the same time.

It will be used for the handling of GPE wakeup from suspend-to-idle
in Linux.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/evxfgpe.c
include/acpi/acpixf.h

index 0cf159cc6e6d79085fa03ef15dcc91d9e53ec409..56710a03c9b0785229ac56470d82cd449f0478d8 100644 (file)
@@ -596,6 +596,38 @@ acpi_status acpi_enable_all_runtime_gpes(void)
 
 ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes)
 
+/******************************************************************************
+ *
+ * FUNCTION:    acpi_enable_all_wakeup_gpes
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Enable all "wakeup" GPEs and disable all of the other GPEs, in
+ *              all GPE blocks.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_enable_all_wakeup_gpes(void)
+{
+       acpi_status status;
+
+       ACPI_FUNCTION_TRACE(acpi_enable_all_wakeup_gpes);
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       status = acpi_hw_enable_all_wakeup_gpes();
+       (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+
+       return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_install_gpe_block
index dc9d037d30551639da6d9bb389abb84108cd7bce..9fc1d71c82bc13faec7d409ebdc280f947544774 100644 (file)
@@ -692,6 +692,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
                                                     *event_status))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
                                acpi_get_gpe_device(u32 gpe_index,