From b999d71c492bdf19e54117c3ffb42170cb352690 Mon Sep 17 00:00:00 2001 From: Kapil Porwal Date: Fri, 30 Jan 2026 19:39:57 +0530 Subject: [PATCH] mb/google/bluey: Restrict low battery LED alert to closed-lid state Refine the critically low battery alert logic to only trigger when the lid is closed. This prevents the red LED alert from firing unnecessarily when the system is open, or ensures it specifically targets the user notification flow designed for a closed-lid blocked boot. This change requires VBOOT_LID_SWITCH to be enabled to correctly detect the lid state in romstage. BUG=none TEST=Verify LED behavior on Google/Quartz with low battery and AC unplugged. Change-Id: Ibe9e7b3bd46527f72a873f161cc359e0641c35f4 Signed-off-by: Kapil Porwal Reviewed-on: https://review.coreboot.org/c/coreboot/+/91012 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- src/mainboard/google/bluey/romstage.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/bluey/romstage.c b/src/mainboard/google/bluey/romstage.c index 2b8e95c201..33878069c6 100644 --- a/src/mainboard/google/bluey/romstage.c +++ b/src/mainboard/google/bluey/romstage.c @@ -2,6 +2,7 @@ #include #include "board.h" +#include #include #include #include @@ -109,8 +110,12 @@ static void early_setup_usb(void) void platform_romstage_main(void) { - /* Set LED to Red to alert the user visually */ - if (CONFIG(EC_GOOGLE_CHROMEEC) && google_chromeec_is_critically_low_on_battery()) + /* + * Only alert the user (set LED to red in color) if the lid is closed and the battery + * is critically low without AC power. + */ + if (CONFIG(EC_GOOGLE_CHROMEEC) && CONFIG(VBOOT_LID_SWITCH) && !get_lid_switch() && + google_chromeec_is_critically_low_on_battery()) google_chromeec_set_lightbar_rgb(0xff, 0xff, 0x00, 0x00); /* Setup early USB related config */