diff options
author | Tommy Chung <tommy.chung@quanta.corp-partner.google.com> | 2021-08-04 18:55:02 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-09 02:22:33 +0000 |
commit | d729a3153b19a4b34e5b7d9afb53a8e421f5a8df (patch) | |
tree | 3d8a89052ee8f17331185f0cbce25a7a634d9c3d | |
parent | f9ee306d41ce328bbc5293d0f5ff478b68a495d0 (diff) | |
download | chrome-ec-d729a3153b19a4b34e5b7d9afb53a8e421f5a8df.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/+/3631843
Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
-rw-r--r-- | common/charge_state_v2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index aea73a0146..4b7c5411d2 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -1990,6 +1990,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 @@ -1998,7 +2002,6 @@ wait_for_it: (is_full != prev_full) || (curr.state != prev_state) || (curr.batt.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; |