mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-02 05:05:09 +00:00
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/449600 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
@@ -154,6 +154,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user