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-05-09 02:22:47 +0000
commitd308cf90aa908fb02b1de500d6397246dedabebf (patch)
treedb137a5ce7afc0dec49ac80fa9c705214b2c1e4d
parent250f9daa4dc1a8e8ae3cb0e9896decf35eee551b (diff)
downloadchrome-ec-d308cf90aa908fb02b1de500d6397246dedabebf.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/+/3573691 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> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631845 Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
-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 832e599678..bf9ac44d5d 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -2519,7 +2519,7 @@ charge_command_charge_control(struct host_cmd_handler_args *args)
if (args->version >= 2) {
if (p->cmd == EC_CHARGE_CONTROL_CMD_SET) {
- if (chg_ctl_mode == CHARGE_CONTROL_NORMAL) {
+ if (p->mode == CHARGE_CONTROL_NORMAL) {
rv = battery_sustainer_set(
p->sustain_soc.lower,
p->sustain_soc.upper);