diff options
author | Duncan Laurie <dlaurie@google.com> | 2019-02-21 17:38:03 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-02-25 11:17:23 +0000 |
commit | a213ed659a5a535875166a8a1d1f631dd6c606f7 (patch) | |
tree | 05d2e377155221cf17d1c7ac61141228030e3125 /src/ec/google/wilco/acpi | |
parent | 47b9e457fa7f80843ee68a6a2daf4115445465c5 (diff) |
ec/google/wilco: Fix ACPI power status events
This change fixes the power status events for AC and battery
events from the EC. The register that was being used is not
returning the expected information.
BUG=b:125472740
TEST=enable ACPI debug in the kernel and verify that AC and
battery insert/remove are detected properly.
Change-Id: I15f71fcf0ca6aa9438e951865787c9fc273792d8
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://review.coreboot.org/c/31560
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/ec/google/wilco/acpi')
-rw-r--r-- | src/ec/google/wilco/acpi/ec.asl | 2 | ||||
-rw-r--r-- | src/ec/google/wilco/acpi/ec_ram.asl | 6 | ||||
-rw-r--r-- | src/ec/google/wilco/acpi/event.asl | 10 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/ec/google/wilco/acpi/ec.asl b/src/ec/google/wilco/acpi/ec.asl index 5aca1878d6..675ee3778e 100644 --- a/src/ec/google/wilco/acpi/ec.asl +++ b/src/ec/google/wilco/acpi/ec.asl @@ -42,7 +42,7 @@ Device (EC0) EREG = Arg1 /* Store initial value for power status */ - ECPR = R (APWR) + ECPR = R (PWSR) /* Indicate to EC that OS is ready for queries */ W (ERDY, Arg1) diff --git a/src/ec/google/wilco/acpi/ec_ram.asl b/src/ec/google/wilco/acpi/ec_ram.asl index 1c030af06f..b7cfefae35 100644 --- a/src/ec/google/wilco/acpi/ec_ram.asl +++ b/src/ec/google/wilco/acpi/ec_ram.asl @@ -53,6 +53,7 @@ Name (P5U1, Package () { 0x04, 0x01, RD }) /* PmSt5_BAT1_UPDATE */ Name (P6ST, Package () { 0x05, 0xff, RD }) /* PmSt6 */ Name (P6AC, Package () { 0x05, 0x08, RD }) /* PmSt6_AC_UPDATE */ +Name (PWSR, Package () { 0x06, 0xff, RD }) /* POWER_SOURCE */ Name (ACEX, Package () { 0x06, 0x01, RD }) /* AC Present */ Name (BTEX, Package () { 0x06, 0x02, RD }) /* Battery Present */ Name (BTSC, Package () { 0x06, 0x04, RD }) /* Battery Status Changed */ @@ -122,11 +123,6 @@ Name (OERL, Package () { 0x3a, 0x02, RD }) /* Event: Rotation Lock */ Name (BCCY, Package () { 0x3e, 0xffff, RD }) /* BCACHE: Cycle Count */ -Name (APWR, Package () { 0x47, 0xff, RD }) /* POWER: Full Status */ -Name (APAC, Package () { 0x47, 0x01, RD }) /* POWER: AC */ -Name (APB1, Package () { 0x47, 0x02, RD }) /* POWER: Main Battery */ -Name (APC1, Package () { 0x47, 0x04, RD }) /* POWER: Main Batt Status */ - /* * EC RAM WRITE */ diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index 24cf268636..fab4fc46c3 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -19,17 +19,17 @@ Name (ECPR, 0) Method (ECQP, 0, Serialized) { - Local0 = R (APWR) + Local0 = R (PWSR) Local1 = Local0 ^ ECPR ECPR = Local0 - If (EBIT (APAC, Local1)) { + If (EBIT (ACEX, Local1)) { Printf ("AC Power Status Changed") Notify (AC, 0x80) } - If (EBIT (APB1, Local1)) { - If (EBIT (APB1, Local0)) { + If (EBIT (BTEX, Local1)) { + If (EBIT (BTEX, Local0)) { Printf ("BAT0 Inserted") Notify (BAT0, 0x81) } Else { @@ -39,7 +39,7 @@ Method (ECQP, 0, Serialized) } } - If (EBIT (APC1, Local1)) { + If (EBIT (BTSC, Local1)) { Printf ("BAT0 Status Change") Notify (BAT0, 0x80) } |