summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2017-08-14 17:46:58 +0200
committerFelix Held <felix-coreboot@felixheld.de>2018-07-19 16:44:15 +0000
commit6b7178aa107ef7e2475e3b1f32ac849d98798406 (patch)
tree0762a1acc7364c58c35c99af63653fe783ec28cd
parent60eca531df7d13272d9d8b41c7992d18fad75a16 (diff)
downloadcoreboot-6b7178aa107ef7e2475e3b1f32ac849d98798406.tar.gz
coreboot-6b7178aa107ef7e2475e3b1f32ac849d98798406.tar.bz2
coreboot-6b7178aa107ef7e2475e3b1f32ac849d98798406.zip
ec/lenovo/h8/ssdt: Add keyboard backlight interface
Add methods MLCG and MLCS for thinkpad_acpi kernel module. Required for backlight or thinklight control from userspace. Change-Id: Ia65e770e772936c9c32be33c30839a2dee2a107c Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/21002 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
-rw-r--r--src/ec/lenovo/h8/acpi/thinkpad.asl31
-rw-r--r--src/ec/lenovo/h8/ssdt.c4
2 files changed, 35 insertions, 0 deletions
diff --git a/src/ec/lenovo/h8/acpi/thinkpad.asl b/src/ec/lenovo/h8/acpi/thinkpad.asl
index d0e4234ed90b..a0812e5d48eb 100644
--- a/src/ec/lenovo/h8/acpi/thinkpad.asl
+++ b/src/ec/lenovo/h8/acpi/thinkpad.asl
@@ -19,6 +19,7 @@ Device (HKEY)
/* Generated by ssdt.c */
External (\HBDC, IntObj)
External (\HWAN, IntObj)
+ External (\HKBL, IntObj)
Name (_HID, EisaId ("IBM0068"))
@@ -228,4 +229,34 @@ Device (HKEY)
/* FIXME: Store state at resume */
}
}
+
+ /*
+ * Argument is unused.
+ * Returns the current state:
+ * Bit 9: Backlight HW present
+ * Bit 0-1: Brightness level
+ */
+ Method (MLCG, 1)
+ {
+ If (HKBL) {
+ Store (0x200, Local0)
+ /* FIXME: Support 2bit brightness control */
+ Or (Local0, \_SB.PCI0.LPCB.EC.KBLT, Local0)
+ Return (Local0)
+ } Else {
+ Return (0)
+ }
+ }
+
+ /*
+ * Set the current state:
+ * Bit 0-1: Brightness level
+ */
+ Method (MLCS, 1)
+ {
+ If (HKBL) {
+ /* FIXME: Support 2bit brightness control */
+ Store (And(Arg0, 1), \_SB.PCI0.LPCB.EC.WWEB)
+ }
+ }
}
diff --git a/src/ec/lenovo/h8/ssdt.c b/src/ec/lenovo/h8/ssdt.c
index 84a52f5f6378..4df4bd8a8753 100644
--- a/src/ec/lenovo/h8/ssdt.c
+++ b/src/ec/lenovo/h8/ssdt.c
@@ -36,6 +36,8 @@ static char *h8_dsdt_scope(struct device *dev, const char *scope)
*/
void h8_ssdt_generator(struct device *dev)
{
+ struct ec_lenovo_h8_config *conf = dev->chip_info;
+
if (!acpi_device_path(dev))
return;
@@ -47,6 +49,8 @@ void h8_ssdt_generator(struct device *dev)
/* Used by thinkpad_acpi */
acpigen_write_name_byte("HBDC", h8_has_bdc(dev) ? ONE_OP : ZERO_OP);
acpigen_write_name_byte("HWAN", h8_has_wwan(dev) ? ONE_OP : ZERO_OP);
+ acpigen_write_name_byte("HKBL", (conf && conf->has_keyboard_backlight) ?
+ ONE_OP : ZERO_OP);
acpigen_pop_len(); /* Scope HKEY */
}