ec/google/chromeec: Add Kconfig for AP-controlled LED sync
Introduce EC_GOOGLE_CHROMEEC_LED_CONTROL to allow boards to opt-in to manual LED/lightbar synchronization. This ensures that the AP firmware can coordinate the lightbar state with boot animations or specific power states (like critical battery alerts) without forcing the logic on all ChromeEC-based platforms. On Bluey, the lightbar logic is refactored into a helper function `platform_init_lightbar()` to improve readability and is now gated by the new Kconfig. Similar gating is applied to Fatcat's romstage. Summary of changes: - Add EC_GOOGLE_CHROMEEC_LED_CONTROL Kconfig option. - Bluey: Refactor lightbar init into a helper and gate by Kconfig. - Fatcat: Gate early lightbar initialization by Kconfig. Change-Id: I6b0294b73b8b9929a6be0e15bf64f7e688b7da8c Signed-off-by: Subrata Banik <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91477 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
parent
12710eafff
commit
fe506bfe84
4 changed files with 20 additions and 7 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue