drivers/acpi/acpica/evxfgpe.c

Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/evxfgpe.c

File Facts

System
Linux kernel
Corpus path
drivers/acpi/acpica/evxfgpe.c
Extension
.c
Size
31630 bytes
Lines
1082
Domain
Driver Families
Bucket
drivers/acpi
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (dispatch_type != ACPI_GPE_DISPATCH_NONE) {
			status = acpi_ev_add_gpe_reference(gpe_event_info, TRUE);
			if (ACPI_SUCCESS(status) &&
			    ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) {

				/* Poll edge-triggered GPEs to handle existing events */

				acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
				(void)acpi_ev_detect_gpe(gpe_device,
							 gpe_event_info,
							 gpe_number);
				flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
			}
		} else {
			status = AE_NO_HANDLER;
		}
	}

	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
	return_ACPI_STATUS(status);
}
ACPI_EXPORT_SYMBOL(acpi_enable_gpe_cond)

/*******************************************************************************
 *
 * FUNCTION:    acpi_enable_gpe
 *
 * PARAMETERS:  gpe_device          - Parent GPE Device. NULL for GPE0/GPE1
 *              gpe_number          - GPE level within the GPE block
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
 *              hardware-enabled.
 *
 ******************************************************************************/
acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
{
	/*
	 * Ensure that there is some way of handling the GPE (handler or a GPE
	 * method). In other words, we won't allow a valid GPE to be enabled if
	 * there is no way to handle it.
	 */
	return acpi_enable_gpe_cond(gpe_device, gpe_number, ACPI_GPE_DISPATCH_MASK);
}
ACPI_EXPORT_SYMBOL(acpi_enable_gpe)

/*******************************************************************************
 *
 * FUNCTION:    acpi_disable_gpe
 *
 * PARAMETERS:  gpe_device      - Parent GPE Device. NULL for GPE0/GPE1
 *              gpe_number      - GPE level within the GPE block
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Remove a reference to a GPE. When the last reference is
 *              removed, only then is the GPE disabled (for runtime GPEs), or
 *              the GPE mask bit disabled (for wake GPEs)
 *
 ******************************************************************************/

acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number)
{
	acpi_status status = AE_BAD_PARAMETER;
	struct acpi_gpe_event_info *gpe_event_info;
	acpi_cpu_flags flags;

	ACPI_FUNCTION_TRACE(acpi_disable_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 = acpi_ev_remove_gpe_reference(gpe_event_info) ;
	}

	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
	return_ACPI_STATUS(status);
}

ACPI_EXPORT_SYMBOL(acpi_disable_gpe)

/*******************************************************************************
 *
 * FUNCTION:    acpi_set_gpe
 *
 * PARAMETERS:  gpe_device          - Parent GPE Device. NULL for GPE0/GPE1

Annotation

Implementation Notes