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 03:01:21 +0000
commit4e87af316cbea556f97827f19304b230743c0893 (patch)
tree37db64d84c39ab9eb798f395d7f5f2b92bd549a4
parenta987b504dd1260d5a67ed154e4e66138677cedb1 (diff)
downloadchrome-ec-4e87af316cbea556f97827f19304b230743c0893.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/+/3573695 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@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 75c9eef855..a66de1223a 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -2764,7 +2764,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);