hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/acpi/acpica/evxfgpe.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -644,17 +644,17 @@
644644 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
645645 * gpe_number - GPE level within the GPE block
646646 *
647
- * RETURN: None
647
+ * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
648648 *
649649 * DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
650650 * (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
651651 *
652652 ******************************************************************************/
653
-void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number)
653
+u32 acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number)
654654 {
655655 ACPI_FUNCTION_TRACE(acpi_dispatch_gpe);
656656
657
- acpi_ev_detect_gpe(gpe_device, NULL, gpe_number);
657
+ return acpi_ev_detect_gpe(gpe_device, NULL, gpe_number);
658658 }
659659
660660 ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe)
....@@ -669,9 +669,9 @@
669669 *
670670 * RETURN: Status
671671 *
672
- * DESCRIPTION: Clear and conditionally reenable a GPE. This completes the GPE
672
+ * DESCRIPTION: Clear and conditionally re-enable a GPE. This completes the GPE
673673 * processing. Intended for use by asynchronous host-installed
674
- * GPE handlers. The GPE is only reenabled if the enable_for_run bit
674
+ * GPE handlers. The GPE is only re-enabled if the enable_for_run bit
675675 * is set in the GPE info.
676676 *
677677 ******************************************************************************/
....@@ -795,6 +795,45 @@
795795
796796 ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
797797
798
+/******************************************************************************
799
+ *
800
+ * FUNCTION: acpi_any_gpe_status_set
801
+ *
802
+ * PARAMETERS: gpe_skip_number - Number of the GPE to skip
803
+ *
804
+ * RETURN: Whether or not the status bit is set for any GPE
805
+ *
806
+ * DESCRIPTION: Check the status bits of all enabled GPEs, except for the one
807
+ * represented by the "skip" argument, and return TRUE if any of
808
+ * them is set or FALSE otherwise.
809
+ *
810
+ ******************************************************************************/
811
+u32 acpi_any_gpe_status_set(u32 gpe_skip_number)
812
+{
813
+ acpi_status status;
814
+ acpi_handle gpe_device;
815
+ u8 ret;
816
+
817
+ ACPI_FUNCTION_TRACE(acpi_any_gpe_status_set);
818
+
819
+ status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
820
+ if (ACPI_FAILURE(status)) {
821
+ return (FALSE);
822
+ }
823
+
824
+ status = acpi_get_gpe_device(gpe_skip_number, &gpe_device);
825
+ if (ACPI_FAILURE(status)) {
826
+ gpe_device = NULL;
827
+ }
828
+
829
+ ret = acpi_hw_check_all_gpes(gpe_device, gpe_skip_number);
830
+ (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
831
+
832
+ return (ret);
833
+}
834
+
835
+ACPI_EXPORT_SYMBOL(acpi_any_gpe_status_set)
836
+
798837 /*******************************************************************************
799838 *
800839 * FUNCTION: acpi_install_gpe_block