diff options
author | Diana Z <dzigterman@chromium.org> | 2021-04-16 12:02:12 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-22 22:30:32 +0000 |
commit | 4746791009b75da679d44d45e8487c57c9191329 (patch) | |
tree | 5401e9c35f6bae95373f5fa472680813dc69d47f /include | |
parent | 7fa18f56441dd596927845198ea61dbe164d7a00 (diff) | |
download | chrome-ec-4746791009b75da679d44d45e8487c57c9191329.tar.gz |
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 <dzigterman@chromium.org>
Change-Id: Iaa1e22a7f5d8be39eb8792ee13d358087d7f7482
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832691
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | include/led_onoff_states.h | 13 |
2 files changed, 2 insertions, 17 deletions
diff --git a/include/config.h b/include/config.h index b9bd58c42d..3de3ab11f0 100644 --- a/include/config.h +++ b/include/config.h @@ -2845,12 +2845,6 @@ #undef CONFIG_LED_ONOFF_STATES_BAT_LOW /* - * Adds a power LED under the control of the board-defined lookup table. - * Must be used with the CONFIG_LED_ONOFF_STATES option. - */ -#undef CONFIG_LED_POWER_LED - -/* * LEDs for LED_POLICY STD may be inverted. In this case they are active low * and the GPIO names will be GPIO_LED..._L. */ diff --git a/include/led_onoff_states.h b/include/led_onoff_states.h index 21a51a8501..355439abe3 100644 --- a/include/led_onoff_states.h +++ b/include/led_onoff_states.h @@ -64,7 +64,6 @@ extern const int led_charge_lvl_1; /* Charging LED state level 2 - defined in board's led.c */ extern const int led_charge_lvl_2; -#ifdef CONFIG_LED_POWER_LED enum pwr_led_states { PWR_LED_STATE_ON, PWR_LED_STATE_SUSPEND_AC, @@ -73,12 +72,6 @@ enum pwr_led_states { PWR_LED_NUM_STATES }; -/* Power LED state table - defined in board's led.c */ -extern const struct led_descriptor - led_pwr_state_table[PWR_LED_NUM_STATES][LED_NUM_PHASES]; - -#endif - /** * Set battery LED color - defined in board's led.c * @@ -87,12 +80,10 @@ extern const struct led_descriptor */ void led_set_color_battery(enum ec_led_colors color); -#ifdef CONFIG_LED_POWER_LED /** - * Set power LED color - defined in board's led.c + * Set power LED color - defined in board's led.c if supported */ -void led_set_color_power(enum ec_led_colors color); -#endif +__override_proto void led_set_color_power(enum ec_led_colors color); __override_proto enum led_states board_get_led_state(enum led_states desired_state); |