diff options
author | Bob Moore <robert.moore@intel.com> | 2009-02-18 14:06:12 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-03-26 16:38:22 -0400 |
commit | 531c633d2be8e79087335a46d3c017ca5837e588 (patch) | |
tree | 603476b57482a8b728a8c218f3a53bf44076b85c /drivers/acpi/acpica/hwregs.c | |
parent | 6fc69d8beb0c16311f737df2c6f677057d50ab05 (diff) |
ACPICA: Split out PM1 status registers from the FADT
Add new globals for the PM1 status registers (A/B), similar to the
way the PM1 enable registers are handled. Instead of overloading
the FADT Event Register blocks. This makes the code clearer and
less prone to error.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/hwregs.c')
-rw-r--r-- | drivers/acpi/acpica/hwregs.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c index 4dc43b01851..7ef0b8eadbc 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c @@ -72,21 +72,23 @@ acpi_status acpi_hw_clear_acpi_status(void) ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", ACPI_BITMASK_ALL_FIXED_STATUS, - (u16) acpi_gbl_FADT.xpm1a_event_block.address)); + (u16) acpi_gbl_xpm1a_status.address)); lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); + /* Clear the fixed events */ + status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS); if (ACPI_FAILURE(status)) { goto unlock_and_exit; } - /* Clear the fixed events */ + /* Write PM1B register if present */ - if (acpi_gbl_FADT.xpm1b_event_block.address) { + if (acpi_gbl_xpm1b_status.address) { status = acpi_write(ACPI_BITMASK_ALL_FIXED_STATUS, - &acpi_gbl_FADT.xpm1b_event_block); + &acpi_gbl_xpm1b_status); if (ACPI_FAILURE(status)) { goto unlock_and_exit; } @@ -150,14 +152,14 @@ acpi_hw_register_read(u32 register_id, u32 * return_value) switch (register_id) { case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ - status = acpi_read(&value1, &acpi_gbl_FADT.xpm1a_event_block); + status = acpi_read(&value1, &acpi_gbl_xpm1a_status); if (ACPI_FAILURE(status)) { goto exit; } /* PM1B is optional */ - status = acpi_read(&value2, &acpi_gbl_FADT.xpm1b_event_block); + status = acpi_read(&value2, &acpi_gbl_xpm1b_status); value1 |= value2; break; @@ -267,14 +269,14 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) /* Now we can write the data */ - status = acpi_write(value, &acpi_gbl_FADT.xpm1a_event_block); + status = acpi_write(value, &acpi_gbl_xpm1a_status); if (ACPI_FAILURE(status)) { goto exit; } /* PM1B is optional */ - status = acpi_write(value, &acpi_gbl_FADT.xpm1b_event_block); + status = acpi_write(value, &acpi_gbl_xpm1b_status); break; case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ |