From 9263722f416cbb9948d4212b2d700ae2933ccf17 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 30 Jan 2026 15:04:26 +0530 Subject: [PATCH] mb/google/fatcat: Refine low battery LED alert conditions Update platform_romstage_pre_mem() to only trigger the red LED alert when the lid is closed. Previously, the critical low battery alert would trigger regardless of the lid state. Checking the lid switch ensures the visual alert is targeted at "closed-lid" scenarios where the user needs a physical indicator of a power-critical state that prevents booting. Change-Id: I9833fb26df9c31989abec142536e1fe7efb93c10 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91007 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/mainboard/google/fatcat/romstage.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/fatcat/romstage.c b/src/mainboard/google/fatcat/romstage.c index 2b3452eff8..4e3c5b764a 100644 --- a/src/mainboard/google/fatcat/romstage.c +++ b/src/mainboard/google/fatcat/romstage.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -48,7 +49,11 @@ void mainboard_memory_init_params(FSPM_UPD *memupd) void platform_romstage_pre_mem(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); }