Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141860
b: refs/heads/master
c: 8636f8d
h: refs/heads/master
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Mar 27, 2009
1 parent 5cf7ee1 commit 5faae65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a335a2331c72e60c6b3ef09b2dedd3ba00da1b1
refs/heads/master: 8636f8d257b3edf5a1529df93119cdc630ed85c7
27 changes: 11 additions & 16 deletions trunk/drivers/acpi/acpica/hwregs.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,22 +273,17 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)

switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */

/* Perform a read first to preserve certain bits (per ACPI spec) */

status = acpi_hw_read_multiple(&read_value,
&acpi_gbl_xpm1a_status,
&acpi_gbl_xpm1b_status);
if (ACPI_FAILURE(status)) {
goto exit;
}

/* Insert the bits to be preserved */

ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
read_value);

/* Now we can write the data */
/*
* Handle the "ignored" bit in PM1 Status. According to the ACPI
* specification, ignored bits are to be preserved when writing.
* Normally, this would mean a read/modify/write sequence. However,
* preserving a bit in the status register is different. Writing a
* one clears the status, and writing a zero preserves the status.
* Therefore, we must always write zero to the ignored bit.
*
* This behavior is clarified in the ACPI 4.0 specification.
*/
value &= ~ACPI_PM1_STATUS_PRESERVED_BITS;

status = acpi_hw_write_multiple(value,
&acpi_gbl_xpm1a_status,
Expand Down

0 comments on commit 5faae65

Please sign in to comment.