diff options
author | elmo_lan <elmo_lan@compal.corp-partner.google.com> | 2021-07-19 14:16:44 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-19 19:00:55 +0000 |
commit | 8c4903ae22ba6bb1977dbff8a8b88c41f779a1dd (patch) | |
tree | 10913e962cbd4dd3ef17de749e51025f7debb406 /common | |
parent | c9127f57b3d9f4837202c2d94e985ae36e53778f (diff) | |
download | chrome-ec-8c4903ae22ba6bb1977dbff8a8b88c41f779a1dd.tar.gz |
LED: modify led_get_state to cover unexpected return when ec initial
When ec initial,
the charge state (curr.state) will be 0 which also mean ST_IDLE,
and led_get_state will get STATE_DISCHARGE_S0.
In this case, we will see led flash.
This CL keeps led off when ec is initial.
BRANCH=dedede
BUG=b:193945782
TEST=On cret, after issue `reboot` via ec console, we won't see led flash.
Signed-off-by: elmo_lan <elmo_lan@compal.corp-partner.google.com>
Change-Id: I2d14c5ac94cfb17486f4596ff7e82e972b18aafe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3037294
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/led_onoff_states.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/led_onoff_states.c b/common/led_onoff_states.c index 8d1dce8971..48886e5de3 100644 --- a/common/led_onoff_states.c +++ b/common/led_onoff_states.c @@ -99,6 +99,8 @@ static enum led_states led_get_state(void) case PWR_STATE_IDLE: /* External power connected in IDLE */ if (charge_get_flags() & CHARGE_FLAG_FORCE_IDLE) new_state = STATE_FACTORY_TEST; + else if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) + new_state = STATE_DISCHARGE_S5; else new_state = STATE_DISCHARGE_S0; break; |