diff options
author | Duncan Laurie <dlaurie@google.com> | 2017-03-07 09:47:29 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-09 01:09:36 -0800 |
commit | b1e212dabe0d4e70e79762f9728113067c7d315b (patch) | |
tree | baeb785a8e3ed667a67e8a99103db10b8dd67d1a /board | |
parent | cf015d1e31c1cfd6e1ff707dbb87b5fce1f6af01 (diff) | |
download | chrome-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')
-rw-r--r-- | board/eve/board.h | 2 | ||||
-rw-r--r-- | board/eve/led.c | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/board/eve/board.h b/board/eve/board.h index f49c5c25c6..f1b90dd82a 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -77,6 +77,7 @@ /* Battery */ #define CONFIG_BATTERY_CUT_OFF #define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION" +#define CONFIG_BATTERY_LEVEL_NEAR_FULL 94 #define CONFIG_BATTERY_PRESENT_CUSTOM #define CONFIG_BATTERY_REVIVE_DISCONNECT #define CONFIG_BATTERY_SMART @@ -109,6 +110,7 @@ #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON #define CONFIG_POWER_SIGNAL_INTERRUPT_STORM_DETECT_THRESHOLD 30 +#define CONFIG_PWR_STATE_DISCHARGE_FULL /* Sensor */ #define CONFIG_MKBP_EVENT 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; |