diff options
author | Bob Moore <robert.moore@intel.com> | 2009-02-18 01:06:12 -0500 |
---|---|---|
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 4dc43b018517..7ef0b8eadbc7 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) | |||
72 | 72 | ||
73 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", | 73 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", |
74 | ACPI_BITMASK_ALL_FIXED_STATUS, | 74 | ACPI_BITMASK_ALL_FIXED_STATUS, |
75 | (u16) acpi_gbl_FADT.xpm1a_event_block.address)); | 75 | (u16) acpi_gbl_xpm1a_status.address)); |
76 | 76 | ||
77 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); | 77 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
78 | 78 | ||
79 | /* Clear the fixed events */ | ||
80 | |||
79 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS, | 81 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS, |
80 | ACPI_BITMASK_ALL_FIXED_STATUS); | 82 | ACPI_BITMASK_ALL_FIXED_STATUS); |
81 | if (ACPI_FAILURE(status)) { | 83 | if (ACPI_FAILURE(status)) { |
82 | goto unlock_and_exit; | 84 | goto unlock_and_exit; |
83 | } | 85 | } |
84 | 86 | ||
85 | /* Clear the fixed events */ | 87 | /* Write PM1B register if present */ |
86 | 88 | ||
87 | if (acpi_gbl_FADT.xpm1b_event_block.address) { | 89 | if (acpi_gbl_xpm1b_status.address) { |
88 | status = acpi_write(ACPI_BITMASK_ALL_FIXED_STATUS, | 90 | status = acpi_write(ACPI_BITMASK_ALL_FIXED_STATUS, |
89 | &acpi_gbl_FADT.xpm1b_event_block); | 91 | &acpi_gbl_xpm1b_status); |
90 | if (ACPI_FAILURE(status)) { | 92 | if (ACPI_FAILURE(status)) { |
91 | goto unlock_and_exit; | 93 | goto unlock_and_exit; |
92 | } | 94 | } |
@@ -150,14 +152,14 @@ acpi_hw_register_read(u32 register_id, u32 * return_value) | |||
150 | switch (register_id) { | 152 | switch (register_id) { |
151 | case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ | 153 | case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ |
152 | 154 | ||
153 | status = acpi_read(&value1, &acpi_gbl_FADT.xpm1a_event_block); | 155 | status = acpi_read(&value1, &acpi_gbl_xpm1a_status); |
154 | if (ACPI_FAILURE(status)) { | 156 | if (ACPI_FAILURE(status)) { |
155 | goto exit; | 157 | goto exit; |
156 | } | 158 | } |
157 | 159 | ||
158 | /* PM1B is optional */ | 160 | /* PM1B is optional */ |
159 | 161 | ||
160 | status = acpi_read(&value2, &acpi_gbl_FADT.xpm1b_event_block); | 162 | status = acpi_read(&value2, &acpi_gbl_xpm1b_status); |
161 | value1 |= value2; | 163 | value1 |= value2; |
162 | break; | 164 | break; |
163 | 165 | ||
@@ -267,14 +269,14 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) | |||
267 | 269 | ||
268 | /* Now we can write the data */ | 270 | /* Now we can write the data */ |
269 | 271 | ||
270 | status = acpi_write(value, &acpi_gbl_FADT.xpm1a_event_block); | 272 | status = acpi_write(value, &acpi_gbl_xpm1a_status); |
271 | if (ACPI_FAILURE(status)) { | 273 | if (ACPI_FAILURE(status)) { |
272 | goto exit; | 274 | goto exit; |
273 | } | 275 | } |
274 | 276 | ||
275 | /* PM1B is optional */ | 277 | /* PM1B is optional */ |
276 | 278 | ||
277 | status = acpi_write(value, &acpi_gbl_FADT.xpm1b_event_block); | 279 | status = acpi_write(value, &acpi_gbl_xpm1b_status); |
278 | break; | 280 | break; |
279 | 281 | ||
280 | case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ | 282 | case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */ |