Commit 9da8e9ac authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPICA: Introduce special struct type for GPE register addresses

Notice that the bit_width, bit_offset and access_width fields in
struct acpi_generic_address are not used during GPE register
accesses any more, so introduce a simplified address structure
type, struct acpi_gpe_address, to represent addresses of GPE
registers and use it instead of struct acpi_generic_address in
struct acpi_gpe_register_info.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f06011ad
......@@ -78,9 +78,9 @@ 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_generic_address *reg);
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg);
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_generic_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);
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -29,7 +29,7 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
* FUNCTION: acpi_hw_gpe_read
*
* PARAMETERS: value - Where the value is returned
* reg - GAS register structure
* reg - GPE register structure
*
* RETURN: Status
*
......@@ -40,7 +40,7 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
*
******************************************************************************/
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_generic_address *reg)
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg)
{
acpi_status status;
u32 value32;
......@@ -65,7 +65,7 @@ acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_generic_address *reg)
* FUNCTION: acpi_hw_gpe_write
*
* PARAMETERS: value - Value to be written
* reg - GAS register structure
* reg - GPE register structure
*
* RETURN: Status
*
......@@ -73,7 +73,7 @@ acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_generic_address *reg)
*
******************************************************************************/
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_generic_address *reg)
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg)
{
if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
return acpi_os_write_memory((acpi_physical_address)reg->address,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment