From a96f1a464b4863adb8fdaa22604c61f72d198c0a Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Tue, 24 Feb 2026 12:39:06 +0530 Subject: [PATCH] mb/google/bluey: Use common platform hook for emergency shutdown Refactor trigger_critical_battery_shutdown() to use the newly implemented platform_handle_emergency_low_battery() hook. This removes duplicate logic from the Bluey mainboard directory and ensures consistency with the ChromeOS common battery handling code for visual alerts and ELOG recording. BUG=none BRANCH=none TEST=Build and boot on Bluey; verify emergency shutdown still triggers red LEDs and logs ELOG events correctly. Change-Id: I28da29eb3f0033abe524f7ee12d6b823392e9766 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91410 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/mainboard/google/bluey/mainboard.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index 89a2a2a0eb..2fc8cfdde9 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -11,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -159,14 +159,7 @@ static void trigger_critical_battery_shutdown(void) if (!CONFIG(EC_GOOGLE_CHROMEEC)) return; - /* Set LED to Red to alert the user visually */ - google_chromeec_set_lightbar_rgb(0xff, 0xff, 0x00, 0x00); - - /* Log the event to CMOS/Flash for post-mortem analysis */ - elog_add_event_byte(ELOG_TYPE_LOW_BATTERY_INDICATOR, ELOG_FW_ISSUE_SHUTDOWN); - - /* Allow time for the log to flush and the user to see the LED change */ - delay(CONFIG_PLATFORM_POST_RENDER_DELAY_SEC); + platform_handle_emergency_low_battery(); google_chromeec_ap_poweroff(); }