aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpica/aclocal.h10
-rw-r--r--drivers/acpi/acpica/hwregs.c15
2 files changed, 24 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 18a8d96eaa49..f01e155b2bcc 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -780,7 +780,15 @@ struct acpi_bit_register_info {
780 * must be preserved. 780 * must be preserved.
781 */ 781 */
782#define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 782#define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */
783#define ACPI_PM1_CONTROL_PRESERVED_BITS 0x0200 /* Bit 9 (whatever) */ 783
784/* For control registers, both ignored and reserved bits must be preserved */
785
786#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0201 /* Bits 9, 0(SCI_EN) */
787#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
788#define ACPI_PM1_CONTROL_PRESERVED_BITS \
789 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
790
791#define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */
784 792
785/* 793/*
786 * Register IDs 794 * Register IDs
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index fd7abe277db3..611736266f9f 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -328,6 +328,21 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
328 328
329 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ 329 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
330 330
331 /*
332 * For control registers, all reserved bits must be preserved,
333 * as per the ACPI spec.
334 */
335 status =
336 acpi_read(&read_value, &acpi_gbl_FADT.xpm2_control_block);
337 if (ACPI_FAILURE(status)) {
338 goto exit;
339 }
340
341 /* Insert the bits to be preserved */
342
343 ACPI_INSERT_BITS(value, ACPI_PM2_CONTROL_PRESERVED_BITS,
344 read_value);
345
331 status = acpi_write(value, &acpi_gbl_FADT.xpm2_control_block); 346 status = acpi_write(value, &acpi_gbl_FADT.xpm2_control_block);
332 break; 347 break;
333 348