From 8fc20c4961f3661c5ce932beed7e1f834929164c Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Mon, 10 Apr 2023 14:10:37 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74332 Tested-by: build bot (Jenkins) Reviewed-by: Rob Barnes Reviewed-by: Tim Van Patten Reviewed-by: Eric Lai --- src/ec/google/chromeec/acpi/ec.asl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ec/google/chromeec/acpi') 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 } -- cgit v1.2.3