diff options
author | Tommy Chung <tommy.chung@quanta.corp-partner.google.com> | 2021-08-04 14:43:23 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-09 02:30:43 +0000 |
commit | f60c312dcf183fdaef40d9a32f092193f8ec89db (patch) | |
tree | a25682c5a0f5d7d60f7c6be9434052cca415f8cd | |
parent | 33aebd3465e12e310c2ef995daa515f2555e1e42 (diff) | |
download | chrome-ec-f60c312dcf183fdaef40d9a32f092193f8ec89db.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
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>
-rw-r--r-- | common/charge_state_v2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index b4dccd1f35..48a9f35b02 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -2741,7 +2741,7 @@ 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); |