Loading drivers/power/qpnp-bms.c +3 −2 Original line number Diff line number Diff line Loading @@ -2264,6 +2264,7 @@ static void configure_soc_wakeup(struct qpnp_bms_chip *chip, (uint16_t)ocv_raw); } #define BAD_SOC_THRESH -10 static int calculate_raw_soc(struct qpnp_bms_chip *chip, struct raw_soc_params *raw, struct soc_params *params, Loading @@ -2280,7 +2281,7 @@ static int calculate_raw_soc(struct qpnp_bms_chip *chip, soc = DIV_ROUND_CLOSEST((remaining_usable_charge_uah * 100), (params->fcc_uah - params->uuc_uah)); if (chip->first_time_calc_soc && soc < 0) { if (chip->first_time_calc_soc && soc > BAD_SOC_THRESH && soc < 0) { /* * first time calcualtion and the pon ocv is too low resulting * in a bad soc. Adjust ocv to get 0 soc Loading @@ -2305,7 +2306,7 @@ static int calculate_raw_soc(struct qpnp_bms_chip *chip, if (soc > 100) soc = 100; if (soc < 0) { if (soc > BAD_SOC_THRESH && soc < 0) { pr_debug("bad rem_usb_chg = %d rem_chg %d, cc_uah %d, unusb_chg %d\n", remaining_usable_charge_uah, params->ocv_charge_uah, Loading Loading
drivers/power/qpnp-bms.c +3 −2 Original line number Diff line number Diff line Loading @@ -2264,6 +2264,7 @@ static void configure_soc_wakeup(struct qpnp_bms_chip *chip, (uint16_t)ocv_raw); } #define BAD_SOC_THRESH -10 static int calculate_raw_soc(struct qpnp_bms_chip *chip, struct raw_soc_params *raw, struct soc_params *params, Loading @@ -2280,7 +2281,7 @@ static int calculate_raw_soc(struct qpnp_bms_chip *chip, soc = DIV_ROUND_CLOSEST((remaining_usable_charge_uah * 100), (params->fcc_uah - params->uuc_uah)); if (chip->first_time_calc_soc && soc < 0) { if (chip->first_time_calc_soc && soc > BAD_SOC_THRESH && soc < 0) { /* * first time calcualtion and the pon ocv is too low resulting * in a bad soc. Adjust ocv to get 0 soc Loading @@ -2305,7 +2306,7 @@ static int calculate_raw_soc(struct qpnp_bms_chip *chip, if (soc > 100) soc = 100; if (soc < 0) { if (soc > BAD_SOC_THRESH && soc < 0) { pr_debug("bad rem_usb_chg = %d rem_chg %d, cc_uah %d, unusb_chg %d\n", remaining_usable_charge_uah, params->ocv_charge_uah, Loading