Commit 9a15da1b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge back earlier ACPICA-related changes for 5.10.

parents 2bfdb7b3 85f94020
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@ ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1a_enable);
ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_status);
ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_enable);

#ifdef ACPI_GPE_USE_LOGICAL_ADDRESSES
ACPI_GLOBAL(unsigned long, acpi_gbl_xgpe0_block_logical_address);
ACPI_GLOBAL(unsigned long, acpi_gbl_xgpe1_block_logical_address);

#endif				/* ACPI_GPE_USE_LOGICAL_ADDRESSES */

/*
 * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
 * determined by the revision of the DSDT: If the DSDT revision is less than
+6 −0
Original line number Diff line number Diff line
@@ -73,9 +73,15 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width);

acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);

acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count);

/*
 * hwgpe - GPE support
 */
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg);

acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg);

u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);

acpi_status
+9 −2
Original line number Diff line number Diff line
@@ -454,11 +454,18 @@ struct acpi_gpe_event_info {
	u8 disable_for_dispatch;	/* Masked during dispatching */
};

/* GPE register address */

struct acpi_gpe_address {
	u8 space_id;	/* Address space where the register exists */
	u64 address;	/* 64-bit address of the register */
};

/* Information about a GPE register pair, one per each status/enable pair in an array */

struct acpi_gpe_register_info {
	struct acpi_generic_address status_address;	/* Address of status reg */
	struct acpi_generic_address enable_address;	/* Address of enable reg */
	struct acpi_gpe_address status_address;	/* Address of status reg */
	struct acpi_gpe_address enable_address;	/* Address of enable reg */
	u16 base_gpe_number;	/* Base GPE number for this register */
	u8 enable_for_wake;	/* GPEs to keep enabled when sleeping */
	u8 enable_for_run;	/* GPEs to keep enabled when running */
+2 −2
Original line number Diff line number Diff line
@@ -656,14 +656,14 @@ acpi_ev_detect_gpe(struct acpi_namespace_node *gpe_device,

	/* GPE currently enabled (enable bit == 1)? */

	status = acpi_hw_read(&enable_reg, &gpe_register_info->enable_address);
	status = acpi_hw_gpe_read(&enable_reg, &gpe_register_info->enable_address);
	if (ACPI_FAILURE(status)) {
		goto error_exit;
	}

	/* GPE currently active (status bit == 1)? */

	status = acpi_hw_read(&status_reg, &gpe_register_info->status_address);
	status = acpi_hw_gpe_read(&status_reg, &gpe_register_info->status_address);
	if (ACPI_FAILURE(status)) {
		goto error_exit;
	}
+19 −8
Original line number Diff line number Diff line
@@ -233,12 +233,6 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)

		this_register->status_address.space_id = gpe_block->space_id;
		this_register->enable_address.space_id = gpe_block->space_id;
		this_register->status_address.bit_width =
		    ACPI_GPE_REGISTER_WIDTH;
		this_register->enable_address.bit_width =
		    ACPI_GPE_REGISTER_WIDTH;
		this_register->status_address.bit_offset = 0;
		this_register->enable_address.bit_offset = 0;

		/* Init the event_info for each GPE within this register */

@@ -251,14 +245,14 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)

		/* Disable all GPEs within this register */

		status = acpi_hw_write(0x00, &this_register->enable_address);
		status = acpi_hw_gpe_write(0x00, &this_register->enable_address);
		if (ACPI_FAILURE(status)) {
			goto error_exit;
		}

		/* Clear any pending GPE events within this register */

		status = acpi_hw_write(0xFF, &this_register->status_address);
		status = acpi_hw_gpe_write(0xFF, &this_register->status_address);
		if (ACPI_FAILURE(status)) {
			goto error_exit;
		}
@@ -317,6 +311,23 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
		return_ACPI_STATUS(AE_OK);
	}

	/* Validate the space_ID */

	if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
	    (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
		ACPI_ERROR((AE_INFO,
			    "Unsupported address space: 0x%X", space_id));
		return_ACPI_STATUS(AE_SUPPORT);
	}

	if (space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
		status = acpi_hw_validate_io_block(address,
						   ACPI_GPE_REGISTER_WIDTH,
						   register_count);
		if (ACPI_FAILURE(status))
			return_ACPI_STATUS(status);
	}

	/* Allocate a new GPE block */

	gpe_block = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_block_info));
Loading