summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-02-25 18:24:38 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-07 20:22:00 -0800
commit63c6378f180c43b29b806ec44d810c1bfa470af7 (patch)
treeda92bb6915c86b809197e03a197f84614efbb9f8
parente5d249549b0cfc761fd81d8eb596bc05da629e1f (diff)
downloadchrome-ec-63c6378f180c43b29b806ec44d810c1bfa470af7.tar.gz
battery/max17055: Report 5 sec average current
Revert CL:982334 since we might want a smoother battery life prediction curve. BUG=b:125946757 TEST=Run a full battery cycle and observe the values reported by ec. BRANCH=none Change-Id: I32d0f05377580df5dc4ff4bce97b6214e5698c2f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1485041 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--driver/battery/max17055.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/battery/max17055.c b/driver/battery/max17055.c
index 1b5679fe37..3e08f52514 100644
--- a/driver/battery/max17055.c
+++ b/driver/battery/max17055.c
@@ -214,7 +214,7 @@ int battery_status(int *status)
if (reg & FSTAT_FQ)
*status |= BATTERY_FULLY_CHARGED;
- rv = max17055_read(REG_CURRENT, &reg);
+ rv = max17055_read(REG_AVERAGE_CURRENT, &reg);
if (rv)
return rv;
if (reg >> 15)
@@ -294,7 +294,7 @@ void battery_get_params(struct batt_params *batt)
batt_new.voltage = VOLTAGE_CONV(reg);
- if (max17055_read(REG_CURRENT, &reg))
+ if (max17055_read(REG_AVERAGE_CURRENT, &reg))
batt_new.flags |= BATT_FLAG_BAD_CURRENT;
batt_new.current = CURRENT_CONV((int16_t)reg);