ec/system76/ec: Preserve ECOS through suspend

When the EC is reset on PLTRST this information will be lost, causing
system control interrupts to potentially stop functioning.

Change-Id: I137ef6c574a372601bc51f6e815158767acd0e1b
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50489
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jeremy Soller
2021-02-10 10:26:14 -07:00
committed by Patrick Georgi
parent 9bce1fe727
commit ff687b1f24

View File

@@ -62,9 +62,13 @@ Device (\_SB.PCI0.LPCB.EC0)
} }
} }
Name (S3OS, Zero)
Method (PTS, 1, Serialized) { Method (PTS, 1, Serialized) {
Debug = Concatenate("EC: PTS: ", ToHexString(Arg0)) Debug = Concatenate("EC: PTS: ", ToHexString(Arg0))
If (ECOK) { If (ECOK) {
// Save ECOS during sleep
S3OS = ECOS
// Clear wake cause // Clear wake cause
WFNO = Zero WFNO = Zero
} }
@@ -73,6 +77,9 @@ Device (\_SB.PCI0.LPCB.EC0)
Method (WAK, 1, Serialized) { Method (WAK, 1, Serialized) {
Debug = Concatenate("EC: WAK: ", ToHexString(Arg0)) Debug = Concatenate("EC: WAK: ", ToHexString(Arg0))
If (ECOK) { If (ECOK) {
// Restore ECOS after sleep
ECOS = S3OS
// Set current AC state // Set current AC state
^^^^AC.ACFG = ADP ^^^^AC.ACFG = ADP