UPSTREAM: 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.

BUG=none
BRANCH=none
TEST=none

Change-Id: Id1345b20413a0dfd9834527b2b20faad2dccc75c
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: f63fbdb63a
Original-Change-Id: I80285f6630b5830766d82e3ecd174c4a51aa9066
Original-Signed-off-by: Stefan Ott <stefan@ott.net>
Original-Reviewed-on: https://review.coreboot.org/19644
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://chromium-review.googlesource.com/506181
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
Stefan Ott 2017-05-10 02:01:44 +02:00 committed by chrome-bot
parent 932bb6a0eb
commit a3705122ee
2 changed files with 20 additions and 0 deletions

View file

@ -107,6 +107,11 @@ Device(EC)
Store(Arg0, USPW)
}
Method (LGHT, 1, NotSerialized)
{
Store(Arg0, KBLT)
}
/* Sleep Button pressed */
Method(_Q13, 0, NotSerialized)

View file

@ -67,6 +67,21 @@ Method(_WAK,1)
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)