From 63c6378f180c43b29b806ec44d810c1bfa470af7 Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Mon, 25 Feb 2019 18:24:38 +0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1485041 Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: Ting Shen Reviewed-by: Nicolas Boichat --- driver/battery/max17055.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'driver') 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); -- cgit v1.2.1