From b68ba242440894f12dcddfe23455fe8bac17de33 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Mon, 23 Feb 2026 10:35:10 +0530 Subject: [PATCH] ec/google/chromeec: Add API to turn on lightbar Implement google_chromeec_lightbar_on() to allow the host to explicitly enable the Chrome EC lightbar. This function sends the LIGHTBAR_CMD_ON sub-command through the EC_CMD_LIGHTBAR_CMD host command. BUG=None TEST=Verified lightbar can be re-enabled after being turned off on supported hardware. Change-Id: I838525ba091281fefb3b6a33b9974037d06706d4 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91381 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/ec/google/chromeec/ec.c | 26 ++++++++++++++++++++++++++ src/ec/google/chromeec/ec.h | 10 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 5fe90c8e39..ab4df3dde2 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -2007,6 +2007,32 @@ int google_chromeec_lightbar_off(void) return google_chromeec_command(&cmd); } +/* + * Sends a command to enable the Chrome EC lightbar. + * + * This function wraps the LIGHTBAR_CMD_ON sub-command into a standard + * EC_CMD_LIGHTBAR_CMD host command. + * + * @return 0 on success, or a non-zero EC transport error code on failure. + */ +int google_chromeec_lightbar_on(void) +{ + const struct ec_params_lightbar req = { + .cmd = LIGHTBAR_CMD_ON, + }; + + struct chromeec_command cmd = { + .cmd_code = EC_CMD_LIGHTBAR_CMD, + .cmd_size_out = 0, + .cmd_data_out = NULL, + .cmd_size_in = sizeof(req), + .cmd_data_in = &req, + }; + + return google_chromeec_command(&cmd); +} + + /* * Check if the battery is critically low and not currently charging. * diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 79aa69bcf8..73ec3eeda8 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -572,6 +572,16 @@ int google_chromeec_set_lightbar_rgb(unsigned int led, int red, int green, */ int google_chromeec_lightbar_off(void); +/* + * Sends a command to enable the Chrome EC lightbar. + * + * This function wraps the LIGHTBAR_CMD_ON sub-command into a standard + * EC_CMD_LIGHTBAR_CMD host command. + * + * @return 0 on success, or a non-zero EC transport error code on failure. + */ +int google_chromeec_lightbar_on(void); + /* * Check if the battery is critically low and AC is not present. *