diff options
author | Devin Lu <devin.lu@quantatw.com> | 2017-10-18 12:12:23 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-10-27 03:34:49 +0000 |
commit | a1ee4630d9a90f19ee5dd1d3e95224aeca3955b8 (patch) | |
tree | 9f30c5edefdaa25da9f8853eb902b5114d9d97ae | |
parent | 5b2a89db08d649b75f47737c1d6cdcd89f8134ee (diff) | |
download | chrome-ec-a1ee4630d9a90f19ee5dd1d3e95224aeca3955b8.tar.gz |
Snappy: Blinking battery white LED on suspend for alan/bigdaddy boards
Support battery led blinking for alan/bigdaddy boards,
because alan/bigdaddy are non-power-led design, we align
battery led behavior same as chell board (CL:332625).
BUG=b:67870473
BRANCH=reef
TEST=put alan/bigdaddy boards in suspend, plug in charger
to see amber LED and then remove the charger and
see that it blinks white again.
Change-Id: I49bd32cbce49f00451ec583a51a4a602db8490b1
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/725007
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/snappy/led.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/board/snappy/led.c b/board/snappy/led.c index ad7ae2f5e1..90657d6d9b 100644 --- a/board/snappy/led.c +++ b/board/snappy/led.c @@ -15,6 +15,7 @@ #include "host_command.h" #include "led_common.h" #include "util.h" +#include "system.h" #define BAT_LED_ON 0 #define BAT_LED_OFF 1 @@ -112,7 +113,24 @@ static void led_set_battery(void) int permillage; battery_ticks++; - power_ticks++; + + /* b/67870473: override battery led for system suspend, + * because Alan/BigDaddy boards are non-power-led design. + */ + switch (system_get_sku_id()) { + case SKU_BIGDADDY_KBDBKLIGHT: + case SKU_BIGDADDY: + case SKU_ALAN: + if (chipset_in_state(CHIPSET_STATE_SUSPEND | + CHIPSET_STATE_STANDBY) && + charge_get_state() != PWR_STATE_CHARGE) { + led_set_color_battery(power_ticks++ & 0x4 ? + LED_WHITE : LED_OFF); + return; + } + } + + power_ticks = 0; remaining_capacity = *(int *)host_get_memmap(EC_MEMMAP_BATT_CAP); full_charge_capacity = *(int *)host_get_memmap(EC_MEMMAP_BATT_LFCC); |