Merge remote-tracking branch 'sound-asoc/for-next'
[deliverable/linux.git] / drivers / acpi / acpica / evxfgpe.c
index 17cfef721d00a40e74ccd6ecda3d4ccbebebc6e4..d7a3b2775505817f1e5f1849ba412c330af095fd 100644 (file)
@@ -235,11 +235,13 @@ acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action)
        case ACPI_GPE_ENABLE:
 
                status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
+               gpe_event_info->disable_for_dispatch = FALSE;
                break;
 
        case ACPI_GPE_DISABLE:
 
                status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
+               gpe_event_info->disable_for_dispatch = TRUE;
                break;
 
        default:
@@ -255,6 +257,47 @@ unlock_and_exit:
 
 ACPI_EXPORT_SYMBOL(acpi_set_gpe)
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_mask_gpe
+ *
+ * PARAMETERS:  gpe_device          - Parent GPE Device. NULL for GPE0/GPE1
+ *              gpe_number          - GPE level within the GPE block
+ *              is_masked           - Whether the GPE is masked or not
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Unconditionally mask/unmask the an individual GPE, ex., to
+ *              prevent a GPE flooding.
+ *
+ ******************************************************************************/
+acpi_status acpi_mask_gpe(acpi_handle gpe_device, u32 gpe_number, u8 is_masked)
+{
+       struct acpi_gpe_event_info *gpe_event_info;
+       acpi_status status;
+       acpi_cpu_flags flags;
+
+       ACPI_FUNCTION_TRACE(acpi_mask_gpe);
+
+       flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+       /* Ensure that we have a valid GPE number */
+
+       gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
+       if (!gpe_event_info) {
+               status = AE_BAD_PARAMETER;
+               goto unlock_and_exit;
+       }
+
+       status = acpi_ev_mask_gpe(gpe_event_info, is_masked);
+
+unlock_and_exit:
+       acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+       return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_mask_gpe)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_mark_gpe_for_wake
This page took 0.025312 seconds and 5 git commands to generate.