summaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2023-04-10 14:10:37 -0600
committerFelix Held <felix-coreboot@felixheld.de>2023-04-12 12:57:55 +0000
commit8fc20c4961f3661c5ce932beed7e1f834929164c (patch)
tree8a144ad05ffeb6e61bffc6fba6fcf72277d13dc7 /src/ec/google/chromeec
parentae4b184ee0cf4551fe3d47da80caa3394a1dc87b (diff)
ec/google/chromeec: Use either EC or MB lid switch state
With CB:16732, EC can provide default lid switch implementation(LID0 ACPI device). Up until that point, mainboard has been providing default switch implementation. When EC provides lid switch implementation, the lid switch state is read from EC either through MMAP or LPC interface. Hence there is no need to keep mainboard's LIDS ACPI object in sync with EC's lid switch state. Use only EC's lid switch state on boards using EC's implementation. This paves the way to remove LIDS ACPI object on those mainboards. BUG=None TEST=Build Skyrim BIOS image and boot to OS. Trigger lid open/close events and ensure that they are detected properly through /proc/acpi/button/lid/LID0/state. localhost ~ # cat /proc/acpi/button/lid/LID0/state state: open localhost ~ # cat /proc/acpi/button/lid/LID0/state state: closed Ensure that the system behaves as expected based on powerd configuration. After signin, system suspends/resumes for lid close/open. On signin screen, system shuts down/boots for lid close/open. Change-Id: I013574d7c21761f167ad38aeed27a419677b8000 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74332 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src/ec/google/chromeec')
-rw-r--r--src/ec/google/chromeec/acpi/ec.asl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index 8109eb3f0f..3d5961aa1b 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -177,8 +177,10 @@ Device (EC0)
*/
\PNOT ()
+#ifndef EC_ENABLE_LID_SWITCH
// Initialize LID switch state
\LIDS = LIDS
+#endif
#if CONFIG(SOC_AMD_COMMON_BLOCK_ACPI_DPTC)
/*
@@ -234,9 +236,10 @@ Device (EC0)
\_SB.DPTC()
}
#endif
- \LIDS = LIDS
#ifdef EC_ENABLE_LID_SWITCH
Notify (LID0, 0x80)
+#else
+ \LIDS = LIDS
#endif
}
@@ -249,10 +252,11 @@ Device (EC0)
\_SB.DPTC()
}
#endif
- \LIDS = LIDS
Notify (CREC, 0x2)
#ifdef EC_ENABLE_LID_SWITCH
Notify (LID0, 0x80)
+#else
+ \LIDS = LIDS
#endif
}