diff options
author | Bruce <Bruce.Wan@quantatw.com> | 2017-03-06 19:30:45 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-03-09 16:07:30 +0000 |
commit | 063422ecb17597dc87418bc8a80bc00234194423 (patch) | |
tree | f78d1b8af6c66a9aa3e9c146a46ac856552ed114 | |
parent | d66ac478ca90c5e48643126e8105e4cb97e2c5b0 (diff) | |
download | chrome-ec-063422ecb17597dc87418bc8a80bc00234194423.tar.gz |
pyro: Add state for discharge + full
Follow reef setting.
When battery is fully charged, pyro starts discharging to protect
battery and starts charging again when charge level goes down
around 95%. To prevent the battery LED from showing green with the
charger plugged in.
BUG=none
BRANCH=reef
TEST=Fully charge Electro. Plug in OEM charger. LED lights green.
Change-Id: If8560cbc3975b35ae84a9df2bdf5331c653143d1
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/452180
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
-rw-r--r-- | board/pyro/board.h | 1 | ||||
-rw-r--r-- | board/pyro/led.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/board/pyro/board.h b/board/pyro/board.h index bc2e06d6ac..a9690934f3 100644 --- a/board/pyro/board.h +++ b/board/pyro/board.h @@ -155,6 +155,7 @@ #define CONFIG_WIRELESS_SUSPEND EC_WIRELESS_SWITCH_WLAN_POWER #define CONFIG_WLAN_POWER_ACTIVE_LOW #define WIRELESS_GPIO_WLAN_POWER GPIO_WIRELESS_GPIO_WLAN_POWER +#define CONFIG_PWR_STATE_DISCHARGE_FULL /* *During shutdown sequence TPS65094x PMIC turns off the sensor rails diff --git a/board/pyro/led.c b/board/pyro/led.c index ec633b4601..18cb8c7201 100644 --- a/board/pyro/led.c +++ b/board/pyro/led.c @@ -133,6 +133,15 @@ static void led_set_battery(void) led_set_color_battery(permillage < FULL_BATTERY_PERMILLAGE ? LED_AMBER : LED_GREEN); break; + case PWR_STATE_DISCHARGE_FULL: + if (extpower_is_present()) { + led_set_color_battery(LED_GREEN); + break; + } + /* Intentional fall-through */ + case PWR_STATE_DISCHARGE: + led_set_color_battery(LED_OFF); + break; case PWR_STATE_CHARGE_NEAR_FULL: led_set_color_battery(LED_GREEN); break; |