Stefan Ott has uploaded a new change for review. ( https://review.coreboot.org/19644 )
Change subject: mb/lenovo/x201: Add support for ThinkLight ......................................................................
mb/lenovo/x201: Add support for ThinkLight
The thinkpad-acpi driver uses the UCMS (CMOS) ACPI method to control the ThinkLight from the Operating System. This patch adds partial support for that method, enough to enable or disable the ThinkLight:
echo on >/proc/acpi/ibm/light echo off >/proc/acpi/ibm/light
With the original BIOS the UCMS method exposes a wide range of values through a generic /proc/acpi/ibm/cmos interface. With the changes suggested in this patch that interface is also exposed but only accepts the commands to enable or disable the ThinkLight; all other commands are ignored.
This change would potentially benefit all currently supported Thinkpad models, I only have an X201 available for tests though.
Change-Id: I80285f6630b5830766d82e3ecd174c4a51aa9066 Signed-off-by: Stefan Ott stefan@ott.net --- M src/ec/lenovo/h8/acpi/ec.asl M src/mainboard/lenovo/x201/acpi/platform.asl 2 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/19644/1
diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl index ed62afe..eed0e16 100644 --- a/src/ec/lenovo/h8/acpi/ec.asl +++ b/src/ec/lenovo/h8/acpi/ec.asl @@ -107,6 +107,11 @@ Store(Arg0, USPW) }
+ Method (LGHT, 1, NotSerialized) + { + Store(Arg0, KBLT) + } +
/* Sleep Button pressed */ Method(_Q13, 0, NotSerialized) diff --git a/src/mainboard/lenovo/x201/acpi/platform.asl b/src/mainboard/lenovo/x201/acpi/platform.asl index 3aa12e9..0a6d5f3 100644 --- a/src/mainboard/lenovo/x201/acpi/platform.asl +++ b/src/mainboard/lenovo/x201/acpi/platform.asl @@ -67,6 +67,21 @@ Return(Package(){0,0}) }
+Method(UCMS, 1, Serialized) +{ + Switch(ToInteger(Arg0)) + { + Case (0x0c) /* Turn on ThinkLight */ + { + _SB.PCI0.LPCB.EC.LGHT(1) + } + Case (0x0d) /* Turn off ThinkLight */ + { + _SB.PCI0.LPCB.EC.LGHT(0) + } + } +} + /* System Bus */
Scope(_SB)