From 26cf0f954e596b0f47763fda444ebf1abafbed69 Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Sat, 5 Mar 2022 10:46:07 +0000 Subject: [PATCH] ec/starlabs: Write the correct value for KLBE when suspending The current code will write the raw value from the CMOS, which doesn't match the respective setting in EC. Switch argument will write the correct value, and prevent the setting being reset. Signed-off-by: Sean Rhodes Change-Id: I40dc78c743f4201a11ea0c26a8af716cab42b805 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62609 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/ec/starlabs/merlin/acpi/suspend.asl | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/ec/starlabs/merlin/acpi/suspend.asl b/src/ec/starlabs/merlin/acpi/suspend.asl index c65ca6d9a5..70a9bda6d4 100644 --- a/src/ec/starlabs/merlin/acpi/suspend.asl +++ b/src/ec/starlabs/merlin/acpi/suspend.asl @@ -113,5 +113,27 @@ Method (RWAK, 1, Serialized) } } - \_SB.PCI0.LPCB.EC.KLBE = \_SB.PCI0.LPCB.KLBC + Switch (ToInteger (\_SB.PCI0.LPCB.KLBC)) + { + // 0x00 == On == 0xdd + // 0x01 == Off == 0xcc + // 0x02 == Low == 0xbb + // 0x03 == High == 0xaa + Case (0x00) + { + \_SB.PCI0.LPCB.EC.KLBE = 0xdd + } + Case (0x01) + { + \_SB.PCI0.LPCB.EC.KLBE = 0xcc + } + Case (0x02) + { + \_SB.PCI0.LPCB.EC.KLBE = 0xbb + } + Case (0x03) + { + \_SB.PCI0.LPCB.EC.KLBE = 0xaa + } + } }