[coreboot-gerrit] Change in coreboot[master]: ec/google: Detect keyboard backlight at runtime

Patrick Georgi (Code Review) gerrit at coreboot.org
Fri Aug 18 21:21:09 CEST 2017


Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/21099


Change subject: ec/google: Detect keyboard backlight at runtime
......................................................................

ec/google: Detect keyboard backlight at runtime

This enables adding the backlight driver to boards that may or may not
come with a keyboard backlight function.
It's the responsibility of the EC to report if that feature exists, but
that's not a big extra burden given that it already keeps track of
everything else related to the backlight.

BUG=b:64705535
BRANCH=none
CQ-DEPEND=CL:620595
TEST=configured the value manually and noticed the presence/absence of
/sys/firmware/platform/GOOG0002:00 on a Chrome OS Linux kernel.

Change-Id: Idc36bfaa6e69581ba19b52d37af6956f63cfdb8f
Signed-off-by: Patrick Georgi <pgeorgi at google.com>
---
M src/ec/google/chromeec/acpi/ec.asl
M src/ec/google/chromeec/acpi/keyboard_backlight.asl
2 files changed, 11 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/21099/1

diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl
index a532492..422abe1 100644
--- a/src/ec/google/chromeec/acpi/ec.asl
+++ b/src/ec/google/chromeec/acpi/ec.asl
@@ -54,6 +54,8 @@
 		PATC, 8,	// Programmable Auxiliary Trip Commit
 		CHGL, 8,	// Charger Current Limit
 		TBMD, 1,	// Tablet mode
+		Offset (0x0a),
+		KBLE, 1,	// Keyboard Backlight exists
 	}
 
 #if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_ACPI_MEMMAP)
diff --git a/src/ec/google/chromeec/acpi/keyboard_backlight.asl b/src/ec/google/chromeec/acpi/keyboard_backlight.asl
index 75a8df3..197536a 100644
--- a/src/ec/google/chromeec/acpi/keyboard_backlight.asl
+++ b/src/ec/google/chromeec/acpi/keyboard_backlight.asl
@@ -23,6 +23,15 @@
 		Name (_HID, "GOOG0002")
 		Name (_UID, 1)
 
+		/* Ask EC if we even have a backlight
+		 * Return 0xf (present, enabled, show in UI, functioning) or 0
+		 */
+		Method (_STA, 0, NotSerialized)
+		{
+			Multiply (0xf, \_SB.PCI0.LPCB.EC0.KBLE, Local0)
+			Return (Local0)
+		}
+
 		/* Read current backlight value */
 		Method (KBQC, 0, NotSerialized)
 		{

-- 
To view, visit https://review.coreboot.org/21099
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc36bfaa6e69581ba19b52d37af6956f63cfdb8f
Gerrit-Change-Number: 21099
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170818/f2a0f81f/attachment.html>


More information about the coreboot-gerrit mailing list