summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-09-10 16:57:18 -0600
committerCommit Bot <commit-bot@chromium.org>2020-09-12 00:18:16 +0000
commit7269813d6e3d0e383abc915c1971deb2cccd45db (patch)
treef6cadcfc4f6b312fcb01c980544dbe0dd212ce6b
parent030490cb4d3cc26a0e29310b28ba11780b93e47a (diff)
downloadchrome-ec-7269813d6e3d0e383abc915c1971deb2cccd45db.tar.gz
OCPC: Check ADCs only with AC present
The OCPC ADCs should only be necessary when AC is present. When AC isn't present, skip gathering them to avoid unnecessary i2c traffic. BRANCH=None BUG=b:165030094 TEST=on drawlat, verify no i2c traffic is seen going to the sub-board with no charger plugged in Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I8319290c52795d009af449644af96bf3a264ab70 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2405494 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--common/charge_state_v2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index d0e87c7fbf..1d5fc48a02 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -1759,7 +1759,8 @@ void charger_task(void *u)
charger_get_params(&curr.chg);
battery_get_params(&curr.batt);
#ifdef CONFIG_OCPC
- ocpc_get_adcs(&curr.ocpc);
+ if (curr.ac)
+ ocpc_get_adcs(&curr.ocpc);
#endif /* CONFIG_OCPC */
if (prev_bp != curr.batt.is_present) {