Skip to content

Commit 7453645

Browse files
committed
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>
1 parent 67b8d5c commit 7453645

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

drivers/acpi/acpica/evgpe.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,12 @@ acpi_ev_detect_gpe(struct acpi_namespace_node *gpe_device,
634634

635635
flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
636636

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+
637643
/* Get the info block for the entire GPE register */
638644

639645
gpe_register_info = gpe_event_info->register_info;

drivers/acpi/acpica/evxfgpe.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,28 @@ acpi_get_gpe_status(acpi_handle gpe_device,
637637

638638
ACPI_EXPORT_SYMBOL(acpi_get_gpe_status)
639639

640+
/*******************************************************************************
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+
640662
/*******************************************************************************
641663
*
642664
* FUNCTION: acpi_finish_gpe

include/acpi/acpixf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
753753
u32 gpe_number,
754754
acpi_event_status
755755
*event_status))
756+
ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number))
756757
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
757758
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
758759
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))

0 commit comments

Comments
 (0)