diff options
author | Jenny Ho <hsiufangho@google.com> | 2023-10-24 17:02:34 +0800 |
---|---|---|
committer | Jenny Ho <hsiufangho@google.com> | 2023-11-06 01:53:24 +0000 |
commit | ec411fa4d9d5787818af1b40cf760e443acfe1a2 (patch) | |
tree | 7b73f0c5301492454111165d6274edd2ca31a492 | |
parent | db2c95139c3e2d2f3fa2cf27ab1046d9476d9ad1 (diff) | |
download | bms-ec411fa4d9d5787818af1b40cf760e443acfe1a2.tar.gz |
google_battery: add debugfs bhi_debug_health_status for testing
Bug: 307433577
Change-Id: I73858c0858d18008ba173f5f5b3fe3ab942cdf18
Signed-off-by: Jenny Ho <hsiufangho@google.com>
(cherry picked from commit ff49bb79077aee4c33e66706fd3e436de61a4c31)
-rw-r--r-- | google_battery.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/google_battery.c b/google_battery.c index f3200d8..89b1467 100644 --- a/google_battery.c +++ b/google_battery.c @@ -372,6 +372,7 @@ struct health_data int bhi_debug_imp_index; int bhi_debug_sd_index; int bhi_debug_health_index; + int bhi_debug_health_status; /* algo BHI_ALGO_INDI capacity threshold */ int bhi_indi_cap; /* algo BHI_ALGO_ACHI_B bounds check */ @@ -4192,6 +4193,9 @@ static enum bhi_status bhi_calc_health_status(int algo, int health_index, { enum bhi_status health_status; + if (data->bhi_debug_health_status) + return data->bhi_debug_health_status; + if (algo == BHI_ALGO_DISABLED) return BH_UNKNOWN; @@ -8288,6 +8292,8 @@ static int batt_init_debugfs(struct batt_drv *batt_drv) &batt_drv->health_data.bhi_debug_sd_index); debugfs_create_u32("bhi_debug_health_idx", 0644, de, &batt_drv->health_data.bhi_debug_health_index); + debugfs_create_u32("bhi_debug_health_status", 0644, de, + &batt_drv->health_data.bhi_debug_health_status); debugfs_create_file("bhi_debug_status", 0644, de, batt_drv, &debug_bhi_status_fops); debugfs_create_file("reset_first_usage_date", 0644, de, batt_drv, @@ -9826,6 +9832,7 @@ static int batt_bhi_init(struct batt_drv *batt_drv) health_data->bhi_debug_imp_index = 0; health_data->bhi_debug_sd_index = 0; health_data->bhi_debug_health_index = 0; + health_data->bhi_debug_health_status = 0; return 0; } |