summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenny Ho <hsiufangho@google.com>2023-11-15 18:26:25 +0800
committerJenny Ho <hsiufangho@google.com>2023-11-28 15:33:56 +0000
commite59abc7f9ea95d90a95c571d13ddecddced342af (patch)
treec0724443c0ea238e5a1910720861d99855336b75
parent4c0fb5146ba032aad4a34819e25fcb7aaa926da8 (diff)
downloadbms-e59abc7f9ea95d90a95c571d13ddecddced342af.tar.gz
google_battery: adjust bhi_weight for different algorithm
The battery impedance has not been verified, remove its weight Bug: 310113663 Change-Id: If05204521ded1de6e5fd45c80c6fd93ca8e329d8 Signed-off-by: Jenny Ho <hsiufangho@google.com> (cherry picked from commit 9825bee4e2c660c92c4e469369fb266abba8ff42)
-rw-r--r--google_battery.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/google_battery.c b/google_battery.c
index 7aa7be0..1e937eb 100644
--- a/google_battery.c
+++ b/google_battery.c
@@ -304,9 +304,9 @@ struct swelling_data {
struct bhi_weight bhi_w[] = {
[BHI_ALGO_ACHI] = {100, 0, 0},
[BHI_ALGO_ACHI_B] = {100, 0, 0},
- [BHI_ALGO_ACHI_RAVG] = {95, 5, 0},
- [BHI_ALGO_ACHI_RAVG_B] = {95, 5, 0},
- [BHI_ALGO_MIX_N_MATCH] = {90, 10, 5},
+ [BHI_ALGO_ACHI_RAVG] = {100, 0, 0},
+ [BHI_ALGO_ACHI_RAVG_B] = {100, 0, 0},
+ [BHI_ALGO_MIX_N_MATCH] = {90, 0, 10},
};
struct bm_date {
@@ -3819,8 +3819,6 @@ static int get_activation_date(struct health_data *health_data, struct rtc_time
static int bhi_individual_conditions_index(struct health_data *health_data)
{
const struct bhi_data *bhi_data = &health_data->bhi_data;
- const int cur_impedance = batt_ravg_value(&bhi_data->res_state);
- const int age_impedance_max = bhi_data->act_impedance * 2;
const int cur_capacity_pct = 100 - bhi_data->capacity_fade;
const int bhi_indi_cap = health_data->bhi_indi_cap;
struct rtc_time tm;
@@ -3842,8 +3840,8 @@ static int bhi_individual_conditions_index(struct health_data *health_data)
battery_age = health_data->bhi_data.battery_age;
}
- if (battery_age >= ONE_YEAR_HRS || cur_capacity_pct <= bhi_indi_cap ||
- (cur_impedance > 0 && age_impedance_max > 0 && cur_impedance >= age_impedance_max))
+ /* Removed impedance condition due to validation required */
+ if (battery_age >= ONE_YEAR_HRS || cur_capacity_pct <= bhi_indi_cap)
return health_data->need_rep_threshold * 100;
return BHI_ALGO_FULL_HEALTH;