diff options
author | Mike Lee <mike5@huaqin.corp-partner.google.com> | 2021-03-06 12:54:57 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-09 02:43:35 +0000 |
commit | 3777478b5de1b4525e28f4ed867405c53082deb7 (patch) | |
tree | 11a64610591b37ad58741f8bfcc5ef9caabbb7a7 | |
parent | bdced69a7fd420711386dcff446f4b5dda643db2 (diff) | |
download | chrome-ec-3777478b5de1b4525e28f4ed867405c53082deb7.tar.gz |
Storo: modify led behavior in battery error state
Modify led behavior in battery error state
BUG=b:181967262
BRANCH=dedede
TEST=make BOARD=storo pass
Verify LED behavior with below items
1. battery low: S0/S3/S5 pass
Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
Change-Id: I4c290af87043d6b4fc45872777aa00de26fbabee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2739009
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | board/storo/led.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/board/storo/led.c b/board/storo/led.c index 54014b10f9..27f8dfe1ac 100644 --- a/board/storo/led.c +++ b/board/storo/led.c @@ -76,3 +76,23 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) } return EC_SUCCESS; } + +__override enum led_states board_led_get_state(enum led_states desired_state) +{ + /* + * Battery error LED behavior as below: + * S0: Blinking Amber LED, 1s on/ 1s off + * S3/S5: following S3/S5 behavior + * Add function to let battery error LED follow S3/S5 behavior in S3/S5. + */ + + if (desired_state == STATE_BATTERY_ERROR) { + if (chipset_in_state(CHIPSET_STATE_ON)) + return desired_state; + else if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND)) + return STATE_DISCHARGE_S3; + else + return STATE_DISCHARGE_S5; + } + return desired_state; +} |