From 8d7183a904e0d0a9fe271014db4cde642cf15e04 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Sun, 19 Oct 2025 17:33:46 -0500 Subject: [PATCH] ec/google/chromeec: Add option to set keyboard backlight level at boot Add the ability to set the keyboard backlight level at boot, controlled by a setup option variable and restricted to devices which actually have a backlit keyboard. TEST=tested hooked up to a CFR option 'ec_kb_backlight' (added later in the patch series) to set the keyboard backlight at boot, with visibility controlled by backlight presence, on a range of Chromebooks with and without keyboard backlight support. Change-Id: I92eed62935d0333f548599860b7bbe22f6b9f2b4 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/89828 Reviewed-by: Caveh Jalali Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel --- src/ec/google/chromeec/ec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index fb8a014d0a..66cf54c4b0 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -10,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1329,6 +1331,11 @@ void google_chromeec_init(void) if (CONFIG(EC_GOOGLE_CHROMEEC_AUTO_FAN_CTRL)) { ec_cmd_thermal_auto_fan_ctrl(PLAT_EC); } + + /* Set keyboard backlight */ + int backlight_level = get_uint_option("ec_kb_backlight", -1); + if (backlight_level != -1 && !acpi_is_wakeup_s3() && google_chromeec_has_kbbacklight()) + google_chromeec_kbbacklight(backlight_level); } int google_ec_running_ro(void)