ec/google/wilco/acpi: Fix S3/S4 support

- Only run _REG on attach
- Reinitialize on WAK to support S3 / Hibernate

Adjustments taken from EC ACPI on Dell 5400/7410 Windows devices.

TEST=build/boot google/drallion, verify S3 sleep works properly as
well as S0ix.

Change-Id: I162d02c7d3c81f1106ddc65a3804f7112dda66b2
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87488
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
CoolStar 2023-03-26 02:35:43 -07:00 committed by Matt DeVillier
commit 89e915e981
2 changed files with 24 additions and 2 deletions

View file

@ -29,6 +29,10 @@ Device (EC0)
OperationRegion (ERAM, EmbeddedControl, 0, 0xff)
Method (_REG, 2)
{
If (Arg1 != 1) {
Return ()
}
/* Indicate region is registered */
EREG = Arg1

View file

@ -4,12 +4,30 @@
Method (PTS, 1, Serialized)
{
Printf ("EC _PTS")
W (FPTS, Arg0)
If (EREG){
W (FPTS, Arg0)
}
}
/* Call from \_SB._WAK() */
Method (WAK, 1, Serialized)
{
Printf ("EC _WAK")
W (FWAK, Arg0)
If (EREG){
W (FWAK, Arg0)
/* Indicate to EC that OS is ready for queries */
W (ERDY, 1)
/* Indicate that the OS supports S0ix */
W (CSOS, 1)
/* Tell EC to stop emulating PS/2 mouse */
W (PS2M, 0)
/* Enable DPTF support if enabled in devicetree */
If (\DPTE == 1) {
W (DWST, 1)
}
}
}