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 <sean@starlabs.systems>
Change-Id: I40dc78c743f4201a11ea0c26a8af716cab42b805
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62609
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Sean Rhodes 2022-03-05 10:46:07 +00:00 committed by Felix Held
parent 40455e9478
commit 26cf0f954e
1 changed files with 23 additions and 1 deletions

View File

@ -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
}
}
}