summaryrefslogtreecommitdiff
path: root/board/eve/led.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-03-07 09:47:29 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-09 01:09:36 -0800
commitb1e212dabe0d4e70e79762f9728113067c7d315b (patch)
treebaeb785a8e3ed667a67e8a99103db10b8dd67d1a /board/eve/led.c
parentcf015d1e31c1cfd6e1ff707dbb87b5fce1f6af01 (diff)
downloadchrome-ec-b1e212dabe0d4e70e79762f9728113067c7d315b.tar.gz
eve: Fix LED behavior when discharging with full battery
In order to prevent noise when using the system with a full battery the EC can disable charging at full until it reaches 97% and then turn on charging again. However this needs additional LED handling to ensure that the charging LED is shown green in this state. BUG=b:36024657 BRANCH=none TEST=manual test with full battery on Eve P1b, ensure that the LED is still green when battery is full and discharging. Change-Id: Iad2b1462ad85163dc9702ff1154f3ff10eb0f7ca Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/450953 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/eve/led.c')
-rw-r--r--board/eve/led.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/eve/led.c b/board/eve/led.c
index ddc3efa567..9c5a08b2bd 100644
--- a/board/eve/led.c
+++ b/board/eve/led.c
@@ -140,6 +140,10 @@ static void eve_led_set_power_battery(void)
PWR_STATE_CHARGE_NEAR_FULL) {
set_color(LED_GREEN, side);
blueside = !side;
+ } else if (chg_state == PWR_STATE_DISCHARGE_FULL &&
+ extpower_is_present()) {
+ set_color(LED_GREEN, side);
+ blueside = !side;
}
set_color(LED_BLUE, blueside);
return;
@@ -165,8 +169,13 @@ static void eve_led_set_power_battery(void)
} else if (chg_state == PWR_STATE_CHARGE) {
set_color(LED_AMBER, side);
blinkside = !side;
+ } else if (chg_state == PWR_STATE_DISCHARGE_FULL &&
+ extpower_is_present()) {
+ set_color(LED_GREEN, side);
+ blinkside = !side;
}
if (chg_state == PWR_STATE_DISCHARGE ||
+ chg_state == PWR_STATE_DISCHARGE_FULL ||
chg_state == PWR_STATE_CHARGE ||
chg_state == PWR_STATE_CHARGE_NEAR_FULL ||
chg_state == PWR_STATE_IDLE) {
@@ -183,6 +192,11 @@ static void eve_led_set_power_battery(void)
/* CHIPSET_STATE_OFF */
switch (chg_state) {
+ case PWR_STATE_DISCHARGE_FULL:
+ set_color(LED_OFF, LED_BOTH);
+ if (extpower_is_present())
+ set_color(LED_GREEN, side);
+ break;
case PWR_STATE_DISCHARGE:
set_color(LED_OFF, LED_BOTH);
break;