diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2020-09-26 09:58:22 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-29 07:17:54 +0000 |
commit | 1ad956ffad4ef43e92924974a8bc180675f18bcc (patch) | |
tree | 0c781f6a5444c6749550ed5f94956d9e53314e56 | |
parent | 598223f3f5d46b7f6c59d169fd4ebf3777bb27e5 (diff) | |
download | chrome-ec-1ad956ffad4ef43e92924974a8bc180675f18bcc.tar.gz |
Esche: Override battery LEDs to indicate system suspend
Esche is non-power LED design, to indicate system suspend, blinking
battery white LED (1 sec on/1 sec off) to indicate system suspend
without charging.
BUG=none
BRANCH=firmware-kukui-12573.B
TEST=Make sure LED blinking on suspend without charging.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I7a2fb73434efec7da3bf5bcd68d658db20418f99
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2432227
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2438069
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | board/burnet/led.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/board/burnet/led.c b/board/burnet/led.c index 56846d0bb2..1f2b75325c 100644 --- a/board/burnet/led.c +++ b/board/burnet/led.c @@ -120,10 +120,28 @@ static void led_set_power(void) static void led_set_battery(void) { static int battery_ticks; + static int power_ticks; uint32_t chflags = charge_get_flags(); battery_ticks++; + /* + * Override battery LED for Esche, Esche don't have power LED, + * blinking battery white LED to indicate system suspend without + * charging. + */ + if (!board_is_convertible()) { + if (chipset_in_state(CHIPSET_STATE_SUSPEND | + CHIPSET_STATE_STANDBY) && + charge_get_state() != PWR_STATE_CHARGE) { + led_set_color_battery(power_ticks++ & 0x2 ? + LED_WHITE : LED_OFF); + return; + } + } + + power_ticks = 0; + switch (charge_get_state()) { case PWR_STATE_CHARGE: led_set_color_battery(LED_AMBER); |