Skip to content

Commit 9da8e9a

Browse files
committed
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent f06011a commit 9da8e9a

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

drivers/acpi/acpica/achware.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count);
7878
/*
7979
* hwgpe - GPE support
8080
*/
81-
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_generic_address *reg);
81+
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg);
8282

83-
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_generic_address *reg);
83+
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg);
8484

8585
u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);
8686

drivers/acpi/acpica/aclocal.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,18 @@ struct acpi_gpe_event_info {
454454
u8 disable_for_dispatch; /* Masked during dispatching */
455455
};
456456

457+
/* GPE register address */
458+
459+
struct acpi_gpe_address {
460+
u8 space_id; /* Address space where the register exists */
461+
u64 address; /* 64-bit address of the register */
462+
};
463+
457464
/* Information about a GPE register pair, one per each status/enable pair in an array */
458465

459466
struct acpi_gpe_register_info {
460-
struct acpi_generic_address status_address; /* Address of status reg */
461-
struct acpi_generic_address enable_address; /* Address of enable reg */
467+
struct acpi_gpe_address status_address; /* Address of status reg */
468+
struct acpi_gpe_address enable_address; /* Address of enable reg */
462469
u16 base_gpe_number; /* Base GPE number for this register */
463470
u8 enable_for_wake; /* GPEs to keep enabled when sleeping */
464471
u8 enable_for_run; /* GPEs to keep enabled when running */

drivers/acpi/acpica/evgpeblk.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,6 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
233233

234234
this_register->status_address.space_id = gpe_block->space_id;
235235
this_register->enable_address.space_id = gpe_block->space_id;
236-
this_register->status_address.bit_width =
237-
ACPI_GPE_REGISTER_WIDTH;
238-
this_register->enable_address.bit_width =
239-
ACPI_GPE_REGISTER_WIDTH;
240-
this_register->status_address.bit_offset = 0;
241-
this_register->enable_address.bit_offset = 0;
242236

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

drivers/acpi/acpica/hwgpe.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
2929
* FUNCTION: acpi_hw_gpe_read
3030
*
3131
* PARAMETERS: value - Where the value is returned
32-
* reg - GAS register structure
32+
* reg - GPE register structure
3333
*
3434
* RETURN: Status
3535
*
@@ -40,7 +40,7 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
4040
*
4141
******************************************************************************/
4242

43-
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_generic_address *reg)
43+
acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg)
4444
{
4545
acpi_status status;
4646
u32 value32;
@@ -65,15 +65,15 @@ acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_generic_address *reg)
6565
* FUNCTION: acpi_hw_gpe_write
6666
*
6767
* PARAMETERS: value - Value to be written
68-
* reg - GAS register structure
68+
* reg - GPE register structure
6969
*
7070
* RETURN: Status
7171
*
7272
* DESCRIPTION: Write to a GPE register in either memory or IO space.
7373
*
7474
******************************************************************************/
7575

76-
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_generic_address *reg)
76+
acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg)
7777
{
7878
if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
7979
return acpi_os_write_memory((acpi_physical_address)reg->address,

0 commit comments

Comments
 (0)