aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2009-03-09 04:32:20 -0400
committerLen Brown <len.brown@intel.com>2009-03-27 12:11:03 -0400
commit8636f8d257b3edf5a1529df93119cdc630ed85c7 (patch)
tree195cc2ab092d085cd945c5ae18e60ffdc0b80bb0 /drivers/acpi
parent8a335a2331c72e60c6b3ef09b2dedd3ba00da1b1 (diff)
ACPICA: Change handling of PM1 Status register ignored bit
Ignored bits must be preserved according to the ACPI spec. Usually this means a read/modify/write when writing to the register. However, for status registers, writing a one means clear the event. Writing a zero means preserve the event (do not clear.) This behavior is clarified in the ACPI 4.0 spec, and the ACPICA code now simply always writes a zero to the ignored bit. 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')
-rw-r--r--drivers/acpi/acpica/hwregs.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index edc627c9fc0d..fd7abe277db3 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -273,22 +273,17 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
273 273
274 switch (register_id) { 274 switch (register_id) {
275 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ 275 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
276 276 /*
277 /* Perform a read first to preserve certain bits (per ACPI spec) */ 277 * Handle the "ignored" bit in PM1 Status. According to the ACPI
278 278 * specification, ignored bits are to be preserved when writing.
279 status = acpi_hw_read_multiple(&read_value, 279 * Normally, this would mean a read/modify/write sequence. However,
280 &acpi_gbl_xpm1a_status, 280 * preserving a bit in the status register is different. Writing a
281 &acpi_gbl_xpm1b_status); 281 * one clears the status, and writing a zero preserves the status.
282 if (ACPI_FAILURE(status)) { 282 * Therefore, we must always write zero to the ignored bit.
283 goto exit; 283 *
284 } 284 * This behavior is clarified in the ACPI 4.0 specification.
285 285 */
286 /* Insert the bits to be preserved */ 286 value &= ~ACPI_PM1_STATUS_PRESERVED_BITS;
287
288 ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
289 read_value);
290
291 /* Now we can write the data */
292 287
293 status = acpi_hw_write_multiple(value, 288 status = acpi_hw_write_multiple(value,
294 &acpi_gbl_xpm1a_status, 289 &acpi_gbl_xpm1a_status,