diff options
author | Ting Shen <phoenixshen@google.com> | 2019-02-25 18:24:38 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-07 20:22:00 -0800 |
commit | 63c6378f180c43b29b806ec44d810c1bfa470af7 (patch) | |
tree | da92bb6915c86b809197e03a197f84614efbb9f8 | |
parent | e5d249549b0cfc761fd81d8eb596bc05da629e1f (diff) | |
download | chrome-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.c | 4 |
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, ®); + rv = max17055_read(REG_AVERAGE_CURRENT, ®); 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, ®)) + if (max17055_read(REG_AVERAGE_CURRENT, ®)) batt_new.flags |= BATT_FLAG_BAD_CURRENT; batt_new.current = CURRENT_CONV((int16_t)reg); |