diff --git a/src/ec/google/chromeec/Kconfig b/src/ec/google/chromeec/Kconfig index b09c64a88c..081f7cb754 100644 --- a/src/ec/google/chromeec/Kconfig +++ b/src/ec/google/chromeec/Kconfig @@ -261,6 +261,12 @@ config EC_GOOGLE_CHROMEEC_BATTERY_SOC_DYNAMIC which retrieves cached telemetry from the EC rather than triggering a synchronous bus transaction to the battery. +config EC_GOOGLE_CHROMEEC_LED_CONTROL + bool + help + Enable manual AP control over ChromeEC LEDs/lightbars to ensure + visual continuity with AP-side boot animations. + endif # EC_GOOGLE_CHROMEEC source "src/ec/google/chromeec/*/Kconfig" diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index 30cf5b13d8..223daf89c8 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -182,7 +182,7 @@ static void mainboard_init(struct device *dev) * This maintains visual consistency between the built-in display * indicators and the external lightbar. */ - if (CONFIG(EC_GOOGLE_CHROMEEC)) + if (CONFIG(EC_GOOGLE_CHROMEEC_LED_CONTROL)) google_chromeec_lightbar_off(); /* Boot to charging applet */ diff --git a/src/mainboard/google/bluey/romstage.c b/src/mainboard/google/bluey/romstage.c index a415228e8b..891809f045 100644 --- a/src/mainboard/google/bluey/romstage.c +++ b/src/mainboard/google/bluey/romstage.c @@ -124,23 +124,30 @@ static void early_setup_usb(void) early_setup_usb_typec(); } -void platform_romstage_main(void) +static void platform_init_lightbar(void) { + if (!CONFIG(EC_GOOGLE_CHROMEEC_LED_CONTROL)) + return; + /* * Early initialization of the Chrome EC lightbar. * Ensures visual continuity if the AP firmware disabled the lightbar * in a previous boot without a subsequent EC reset. */ - if (CONFIG(EC_GOOGLE_CHROMEEC)) - google_chromeec_lightbar_on(); + google_chromeec_lightbar_on(); /* * 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()) + if (CONFIG(VBOOT_LID_SWITCH) && !get_lid_switch() && + google_chromeec_is_critically_low_on_battery()) google_chromeec_set_lightbar_rgb(0xff, 0xff, 0x00, 0x00); +} + +void platform_romstage_main(void) +{ + platform_init_lightbar(); /* Setup early USB related config */ early_setup_usb(); diff --git a/src/mainboard/google/fatcat/romstage.c b/src/mainboard/google/fatcat/romstage.c index 5098cd3d8b..04b39c58c4 100644 --- a/src/mainboard/google/fatcat/romstage.c +++ b/src/mainboard/google/fatcat/romstage.c @@ -53,7 +53,7 @@ void platform_romstage_pre_mem(void) * Ensures visual continuity if the AP firmware disabled the lightbar * in a previous boot without a subsequent EC reset. */ - if (CONFIG(EC_GOOGLE_CHROMEEC)) + if (CONFIG(EC_GOOGLE_CHROMEEC_LED_CONTROL)) google_chromeec_lightbar_on(); /*