summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2021-08-04 18:55:02 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-21 00:42:42 +0000
commit2f9da0a0bb1086f2273b3cb2512e8f31b37d82fc (patch)
treeb4f7a717d9dbd7f46fca8a164ebb87b7d004022e
parente401ae9cff33a8ddf5447aea42dc5d2bead9b005 (diff)
downloadchrome-ec-2f9da0a0bb1086f2273b3cb2512e8f31b37d82fc.tar.gz
chgstv2: call sustain_battery_soc without checking previous states
When we enalbe battery sustain after battery returns that it is full, we need to add this condition for sustain_battery_soc(). Also, add this test condition for battery sustainer. BUG=b:188457962 BRANCH=none TEST=make sure the battery sustain works when enabling it after battery returns that it is full. Also, make sure that "make run-sbs_charging_v2" pass. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: If10b9fd0264717abfb7cdbb7ddc947b370291895 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3070946 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3105744
-rw-r--r--common/charge_state_v2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index b8ad1fc425..49b001fa7f 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -1934,6 +1934,10 @@ wait_for_it:
/* And the EC console */
is_full = calc_is_full();
+
+ /* Run battery sustainer (no-op if not applicable). */
+ sustain_battery_soc();
+
if ((!(curr.batt.flags & BATT_FLAG_BAD_STATE_OF_CHARGE) &&
curr.batt.state_of_charge != prev_charge) ||
#ifdef CONFIG_EC_EC_COMM_BATTERY_MASTER
@@ -1942,7 +1946,6 @@ wait_for_it:
(is_full != prev_full) ||
(curr.state != prev_state) ||
(charge_get_display_charge() != prev_disp_charge)) {
- sustain_battery_soc();
show_charging_progress();
prev_charge = curr.batt.state_of_charge;
prev_disp_charge = curr.batt.display_charge;