From 4746791009b75da679d44d45e8487c57c9191329 Mon Sep 17 00:00:00 2001 From: Diana Z Date: Fri, 16 Apr 2021 12:02:12 -0600 Subject: LED On/Off: Remove power LED config Move the LED on/off module towards using a more flexible LED support approach. Define a weak power LED table and setter for boards to override when needed. Note that during run-time these functions will not get called since led_auto_control_is_enabled() will return false for nonexistent LEDs. This consumes an average of 165 additional bytes of flash space on boards which do not use a power LED. BRANCH=None BUG=b:185508707 TEST=make -j buildall, load on guybrush (battery LED only) and confirm no errors are seen. Load on Boten (both LEDs) and confirm behavior appears normal Signed-off-by: Diana Z Change-Id: Iaa1e22a7f5d8be39eb8792ee13d358087d7f7482 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832691 Reviewed-by: Aseda Aboagye --- board/lick/led.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board/lick/led.c') diff --git a/board/lick/led.c b/board/lick/led.c index 3985c519f3..862eba52cb 100644 --- a/board/lick/led.c +++ b/board/lick/led.c @@ -31,7 +31,7 @@ struct led_descriptor led_bat_state_table[LED_NUM_STATES][LED_NUM_PHASES] = { {EC_LED_COLOR_GREEN, 2 * LED_ONE_SEC} }, }; -const struct led_descriptor +__override const struct led_descriptor led_pwr_state_table[PWR_LED_NUM_STATES][LED_NUM_PHASES] = { [PWR_LED_STATE_ON] = {{EC_LED_COLOR_WHITE, LED_INDEFINITE} }, [PWR_LED_STATE_SUSPEND_AC] = {{EC_LED_COLOR_WHITE, 3 * LED_ONE_SEC}, @@ -47,7 +47,7 @@ const enum ec_led_id supported_led_ids[] = { const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); -void led_set_color_power(enum ec_led_colors color) +__override void led_set_color_power(enum ec_led_colors color) { if (color == EC_LED_COLOR_WHITE) gpio_set_level(GPIO_PWR_LED_WHITE_L, LED_ON_LVL); -- cgit v1.2.1