Loading drivers/power/supply/qcom/fg-alg.c +7 −5 Original line number Diff line number Diff line Loading @@ -391,13 +391,15 @@ static int cap_learning_process_full_data(struct cap_learning *cl) */ static int cap_learning_begin(struct cap_learning *cl, u32 batt_soc) { int rc, cc_soc_sw, batt_soc_msb; int rc, cc_soc_sw, batt_soc_msb, batt_soc_pct; batt_soc_msb = batt_soc >> 24; if (DIV_ROUND_CLOSEST(batt_soc_msb * 100, FULL_SOC_RAW) > cl->dt.start_soc) { pr_debug("Battery SOC %d is high!, not starting\n", batt_soc_msb); batt_soc_pct = DIV_ROUND_CLOSEST(batt_soc_msb * 100, FULL_SOC_RAW); if (batt_soc_pct > cl->dt.max_start_soc || batt_soc_pct < cl->dt.min_start_soc) { pr_debug("Battery SOC %d is high/low, not starting\n", batt_soc_pct); return -EINVAL; } Loading drivers/power/supply/qcom/fg-alg.h +2 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ struct cycle_counter { }; struct cl_params { int start_soc; int min_start_soc; int max_start_soc; int max_temp; int min_temp; int max_cap_inc; Loading drivers/power/supply/qcom/qpnp-fg-gen4.c +2 −2 Original line number Diff line number Diff line Loading @@ -2941,9 +2941,9 @@ static int fg_gen4_parse_dt(struct fg_gen4_chip *chip) rc = of_property_read_u32(node, "qcom,cl-start-capacity", &temp); if (rc < 0) chip->cl->dt.start_soc = DEFAULT_CL_START_SOC; chip->cl->dt.max_start_soc = DEFAULT_CL_START_SOC; else chip->cl->dt.start_soc = temp; chip->cl->dt.max_start_soc = temp; rc = of_property_read_u32(node, "qcom,cl-min-temp", &temp); if (rc < 0) Loading Loading
drivers/power/supply/qcom/fg-alg.c +7 −5 Original line number Diff line number Diff line Loading @@ -391,13 +391,15 @@ static int cap_learning_process_full_data(struct cap_learning *cl) */ static int cap_learning_begin(struct cap_learning *cl, u32 batt_soc) { int rc, cc_soc_sw, batt_soc_msb; int rc, cc_soc_sw, batt_soc_msb, batt_soc_pct; batt_soc_msb = batt_soc >> 24; if (DIV_ROUND_CLOSEST(batt_soc_msb * 100, FULL_SOC_RAW) > cl->dt.start_soc) { pr_debug("Battery SOC %d is high!, not starting\n", batt_soc_msb); batt_soc_pct = DIV_ROUND_CLOSEST(batt_soc_msb * 100, FULL_SOC_RAW); if (batt_soc_pct > cl->dt.max_start_soc || batt_soc_pct < cl->dt.min_start_soc) { pr_debug("Battery SOC %d is high/low, not starting\n", batt_soc_pct); return -EINVAL; } Loading
drivers/power/supply/qcom/fg-alg.h +2 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ struct cycle_counter { }; struct cl_params { int start_soc; int min_start_soc; int max_start_soc; int max_temp; int min_temp; int max_cap_inc; Loading
drivers/power/supply/qcom/qpnp-fg-gen4.c +2 −2 Original line number Diff line number Diff line Loading @@ -2941,9 +2941,9 @@ static int fg_gen4_parse_dt(struct fg_gen4_chip *chip) rc = of_property_read_u32(node, "qcom,cl-start-capacity", &temp); if (rc < 0) chip->cl->dt.start_soc = DEFAULT_CL_START_SOC; chip->cl->dt.max_start_soc = DEFAULT_CL_START_SOC; else chip->cl->dt.start_soc = temp; chip->cl->dt.max_start_soc = temp; rc = of_property_read_u32(node, "qcom,cl-min-temp", &temp); if (rc < 0) Loading