summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2021-08-04 14:43:23 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-07 18:08:02 +0000
commit5719ae1a67221a096eaf0fd290b1173599c31b98 (patch)
tree5184dff6c5e78ba233285cd5361a50625f7cfbd7
parent72effbc8d85aca8ba5163c5ebbcbdfe63c6577d6 (diff)
downloadchrome-ec-5719ae1a67221a096eaf0fd290b1173599c31b98.tar.gz
chgstv2: rework "charge_command_charge_control()"
Condition of judging whether to enable or disable the battery sustainer should be the mode host commands give, not the current chg_ctl_mode. BUG=b:194219157, b:222620437 BRANCH=none TEST=make sure that the battery sustainer will not be incorrectly enabled when giving "ectool chargecontrol discharge" or "ectool chargecontrol idle" under CHARGE_CONTROL_NORMAL mode. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I8a28970164a7e80805601817f2761d6684b183cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3070328 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> (cherry picked from commit f60c312dcf183fdaef40d9a32f092193f8ec89db) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3573693 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
-rw-r--r--common/charge_state_v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 43413570de..25e1570505 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -2396,7 +2396,7 @@ static int charge_command_charge_control(struct host_cmd_handler_args *args)
if (args->version >= 2) {
if (p->cmd == EC_CHARGE_CONTROL_CMD_SET) {
- if (get_chg_ctrl_mode() == CHARGE_CONTROL_NORMAL) {
+ if (p->mode == CHARGE_CONTROL_NORMAL) {
rv = battery_sustainer_set(
p->sustain_soc.lower,
p->sustain_soc.upper);