summaryrefslogtreecommitdiff
path: root/board/burnet/led.c
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2020-09-26 09:58:22 +0800
committerCommit Bot <commit-bot@chromium.org>2020-09-29 06:36:29 +0000
commit27fb984fd08032ab74729554d5a5b7c1a5066005 (patch)
treee7e3755fd6c0b72eb25319d9e6a9db7dc1d43cb9 /board/burnet/led.c
parentb10cec1fbf30a02ba582f345ec4f663935624022 (diff)
downloadchrome-ec-27fb984fd08032ab74729554d5a5b7c1a5066005.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>
Diffstat (limited to 'board/burnet/led.c')
-rw-r--r--board/burnet/led.c18
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);