Merge "power: qpnp-bms: always limit soc to [0, 100]"
diff --git a/drivers/power/qpnp-bms.c b/drivers/power/qpnp-bms.c
index 537dc1d..6752828 100644
--- a/drivers/power/qpnp-bms.c
+++ b/drivers/power/qpnp-bms.c
@@ -2209,7 +2209,6 @@
rc_new_uah = (params->fcc_uah * pc_new) / 100;
soc_new = (rc_new_uah - params->cc_uah - params->uuc_uah)*100
/ (params->fcc_uah - params->uuc_uah);
- soc_new = bound_soc(soc_new);
/*
* if soc_new is ZERO force it higher so that phone doesnt report soc=0
@@ -2467,6 +2466,8 @@
/* always clamp soc due to BMS hw/sw immaturities */
new_calculated_soc = clamp_soc_based_on_voltage(chip,
new_calculated_soc);
+
+ new_calculated_soc = bound_soc(new_calculated_soc);
/*
* If the battery is full, configure the cc threshold so the system
* wakes up after SoC changes