diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-05-25 04:30:35 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-05-25 04:30:35 -0400 |
commit | 745364533e40ec76f7822275d491f5196362e016 (patch) | |
tree | 8d4b9d26febb4de2832f4bc61cbb067d827bfbce | |
parent | 67b8d5c7081221efa252e111cd52532ec6d4266f (diff) |
ACPICA: Introduce acpi_dispatch_gpe()
Introduce acpi_dispatch_gpe() as a wrapper around acpi_ev_detect_gpe()
for checking if the given GPE (as represented by a GPE device handle
and a GPE number) is currently active and dispatching it (if that's
the case) outside of interrupt context.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/acpica/evgpe.c | 6 | ||||
-rw-r--r-- | drivers/acpi/acpica/evxfgpe.c | 22 | ||||
-rw-r--r-- | include/acpi/acpixf.h | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index abbd59063906..e10fec99a182 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
@@ -634,6 +634,12 @@ acpi_ev_detect_gpe(struct acpi_namespace_node *gpe_device, | |||
634 | 634 | ||
635 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | 635 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); |
636 | 636 | ||
637 | if (!gpe_event_info) { | ||
638 | gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); | ||
639 | if (!gpe_event_info) | ||
640 | goto error_exit; | ||
641 | } | ||
642 | |||
637 | /* Get the info block for the entire GPE register */ | 643 | /* Get the info block for the entire GPE register */ |
638 | 644 | ||
639 | gpe_register_info = gpe_event_info->register_info; | 645 | gpe_register_info = gpe_event_info->register_info; |
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c index c80e3bdf4805..b2d5f66cc1b0 100644 --- a/drivers/acpi/acpica/evxfgpe.c +++ b/drivers/acpi/acpica/evxfgpe.c | |||
@@ -639,6 +639,28 @@ ACPI_EXPORT_SYMBOL(acpi_get_gpe_status) | |||
639 | 639 | ||
640 | /******************************************************************************* | 640 | /******************************************************************************* |
641 | * | 641 | * |
642 | * FUNCTION: acpi_gispatch_gpe | ||
643 | * | ||
644 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 | ||
645 | * gpe_number - GPE level within the GPE block | ||
646 | * | ||
647 | * RETURN: None | ||
648 | * | ||
649 | * DESCRIPTION: Detect and dispatch a General Purpose Event to either a function | ||
650 | * (e.g. EC) or method (e.g. _Lxx/_Exx) handler. | ||
651 | * | ||
652 | ******************************************************************************/ | ||
653 | void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number) | ||
654 | { | ||
655 | ACPI_FUNCTION_TRACE(acpi_dispatch_gpe); | ||
656 | |||
657 | acpi_ev_detect_gpe(gpe_device, NULL, gpe_number); | ||
658 | } | ||
659 | |||
660 | ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe) | ||
661 | |||
662 | /******************************************************************************* | ||
663 | * | ||
642 | * FUNCTION: acpi_finish_gpe | 664 | * FUNCTION: acpi_finish_gpe |
643 | * | 665 | * |
644 | * PARAMETERS: gpe_device - Namespace node for the GPE Block | 666 | * PARAMETERS: gpe_device - Namespace node for the GPE Block |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index da0215ea9f44..c01d790c17c2 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -753,6 +753,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
753 | u32 gpe_number, | 753 | u32 gpe_number, |
754 | acpi_event_status | 754 | acpi_event_status |
755 | *event_status)) | 755 | *event_status)) |
756 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number)) | ||
756 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) | 757 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) |
757 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) | 758 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) |
758 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void)) | 759 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void)) |