summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenny Ho <hsiufangho@google.com>2023-09-21 18:12:52 +0800
committerJenny Ho <hsiufangho@google.com>2023-10-17 05:44:26 +0000
commitafb8709e90e6ed0bbf8c68d776d5369a50122103 (patch)
treed615091914c0df63a25bf4e1e62fb247e53a83e8
parent3939e72319c2eac7f27c3c73533958e0510e5a1e (diff)
downloadbms-afb8709e90e6ed0bbf8c68d776d5369a50122103.tar.gz
google_battery: update bhi data when FG ready
Bug: 286925379 Change-Id: Iddbb90b9180330ae568f2212e91e360ac53c4d02 Signed-off-by: Jenny Ho <hsiufangho@google.com> (cherry picked from commit 291f94ba321cb3226e79ae5c7ad6a101ca628b16)
-rw-r--r--google_battery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/google_battery.c b/google_battery.c
index a701bca..a782f9a 100644
--- a/google_battery.c
+++ b/google_battery.c
@@ -7131,6 +7131,10 @@ static ssize_t health_index_stats_show(struct device *dev,
struct health_data *health_data = &batt_drv->health_data;
int len = 0, i;
+ /* might be POR and FG not ready */
+ if (bhi_data->battery_age <= 0 && bhi_data->cycle_count <= 0)
+ return len;
+
mutex_lock(&batt_drv->chg_lock);
for (i = 0; i < BHI_ALGO_MAX; i++) {