summaryrefslogtreecommitdiff
path: root/board/reef
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-03-03 09:34:44 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-03 17:11:30 -0800
commit7757a8e872588fda9643f31399c5641982e07439 (patch)
treefabf612c1ca485666c39c755720be27eb412da2e /board/reef
parent9c24fac50542e2a391f509dad98303667c82c655 (diff)
downloadchrome-ec-7757a8e872588fda9643f31399c5641982e07439.tar.gz
charger: Add state for discharge + full
When battery is fully charged, Reef starts discharging to protect battery and starts charging again when charge level goes down around 95%. To prevent the battery LED from showing blue with the charger plugged in, this patch adds a new state for discharge + nearly full. Reef shows a color indicating battery is full if an external charger is present. BUG=b:35775017 BRANCH=none TEST=Fully charge Electro. Plug in OEM charger. LED lights blue. Change-Id: I4c7c62f2c51c1d39188d1b271331984e89d5d7a3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/448961 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'board/reef')
-rw-r--r--board/reef/board.h1
-rw-r--r--board/reef/led.c8
2 files changed, 8 insertions, 1 deletions
diff --git a/board/reef/board.h b/board/reef/board.h
index 0e7ef3b2e0..44eb37ffca 100644
--- a/board/reef/board.h
+++ b/board/reef/board.h
@@ -149,6 +149,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/reef/led.c b/board/reef/led.c
index ee06d31995..b559a00da8 100644
--- a/board/reef/led.c
+++ b/board/reef/led.c
@@ -100,7 +100,13 @@ static void led_set_battery(void)
case PWR_STATE_CHARGE:
led_set_color_battery(LED_AMBER);
break;
- case PWR_STATE_DISCHARGE:
+ case PWR_STATE_DISCHARGE_FULL:
+ if (extpower_is_present()) {
+ led_set_color_battery(LED_BLUE);
+ break;
+ }
+ /* Intentional fall-through */
+ case PWR_STATE_DISCHARGE /* and PWR_STATE_DISCHARGE_FULL */:
if (chipset_in_state(CHIPSET_STATE_ON)) {
led_set_color_battery(LED_BLUE);
} else if (chipset_in_state(CHIPSET_STATE_SUSPEND |