summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <devin.lu@quantatw.com>2019-08-26 11:13:17 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-29 05:46:40 +0000
commit2c49a96a9215d29d14e41dcc0554c6aa33e46d3a (patch)
treef5bfb91d1b26f1490a63f6f08cef25df06f3217b
parent2c12e10279e792710b7c803547151679116e2866 (diff)
downloadchrome-ec-stabilize-12464.B.tar.gz
blooglet: override battery LEDs to indicate system suspendstabilize-12464.B
As meep, careena and snappy we have some SKUs are non-power LED design, blinking both two side battery white LEDs (1 sec on/1 sec off) to indicate system suspend with non-charging state. BUG=none BRANCH=octopus TEST=make sure both two side LEDs are blinking white after system suspend. Change-Id: I2839309acb91e365b98b5aac024bb7d7ebf287eb Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1771099 Reviewed-by: Marco Chen <marcochen@chromium.org>
-rw-r--r--board/bloog/led.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/board/bloog/led.c b/board/bloog/led.c
index 77e5212b91..ba1a865890 100644
--- a/board/bloog/led.c
+++ b/board/bloog/led.c
@@ -129,10 +129,33 @@ static void set_active_port_color(enum led_color color)
static void led_set_battery(void)
{
static int battery_ticks;
+ static int power_ticks;
uint32_t chflags = charge_get_flags();
battery_ticks++;
+ /*
+ * Override battery LEDs for Blooglet, Blooglet is non-power LED
+ * design, blinking both two side battery white LEDs to indicate
+ * system suspend with non-charging state.
+ */
+ if (!board_is_convertible()) {
+ if (chipset_in_state(CHIPSET_STATE_SUSPEND |
+ CHIPSET_STATE_STANDBY) &&
+ charge_get_state() != PWR_STATE_CHARGE) {
+
+ power_ticks++;
+
+ led_set_color_battery(0, power_ticks & 0x4 ?
+ LED_WHITE : LED_OFF);
+ led_set_color_battery(1, power_ticks & 0x4 ?
+ LED_WHITE : LED_OFF);
+ return;
+ }
+ }
+
+ power_ticks = 0;
+
switch (charge_get_state()) {
case PWR_STATE_CHARGE:
/* Always indicate when charging, even in suspend. */