diff options
author | Parth Malkan <parthmalkan@google.com> | 2022-08-03 10:50:35 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-18 01:27:00 +0000 |
commit | 3452193de27d586b922a53b7958a92baae744a8c (patch) | |
tree | 337bd22ee032e1b9a8acc685c33617f8f08704b5 /board/beadrix | |
parent | f445908cffd253185fe0287f46eb3f7f25a56c12 (diff) | |
download | chrome-ec-3452193de27d586b922a53b7958a92baae744a8c.tar.gz |
charge_state: Add PWR_STATE_FORCED_IDLE state
Add PWR_STATE_FORCED_IDLE state which indicates PWR_STATE_IDLE state is
forced when charge control is not normal.
Also update led.c files for boards to replace chflag use with new
PWR_STATE_FORCED_IDLE.
BUG=b:241167493
TEST=make buildall, zmake build --all, make runhosttests -j
BRANCH=None
Signed-off-by: Parth Malkan <parthmalkan@google.com>
Cq-Depend: chromium:3807136
Change-Id: Ib00ed3df977482a4430b0c3d16a2a0e305bbd47f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3807134
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/beadrix')
-rw-r--r-- | board/beadrix/led.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/board/beadrix/led.c b/board/beadrix/led.c index 8b81f6fea8..da8cb5f052 100644 --- a/board/beadrix/led.c +++ b/board/beadrix/led.c @@ -63,7 +63,6 @@ static void board_led_set_battery(void) static int battery_ticks; enum led_color color = LED_OFF; int period = 0; - uint32_t chflags = charge_get_flags(); battery_ticks++; @@ -103,16 +102,16 @@ static void board_led_set_battery(void) color = LED_BLUE; break; case PWR_STATE_IDLE: /* External power connected in IDLE */ - if (chflags & CHARGE_FLAG_FORCE_IDLE) { - /* Factory mode: Blue 2 sec, Red 2 sec */ - period = (2 + 2) * LED_ONE_SEC; - battery_ticks = battery_ticks % period; - if (battery_ticks < 2 * LED_ONE_SEC) - color = LED_BLUE; - else - color = LED_RED; - } else + color = LED_BLUE; + break; + case PWR_STATE_FORCED_IDLE: + /* Factory mode: Blue 2 sec, Red 2 sec */ + period = (2 + 2) * LED_ONE_SEC; + battery_ticks = battery_ticks % period; + if (battery_ticks < 2 * LED_ONE_SEC) color = LED_BLUE; + else + color = LED_RED; break; default: /* Other states don't alter LED behavior */ |