Loading drivers/power/supply/qcom/fg-alg.c +5 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,11 @@ static int cap_learning_begin(struct cap_learning *cl, u32 batt_soc_cp) int rc, cc_soc_sw, batt_soc_pct; u32 batt_soc_prime; if (cl->ok_to_begin && !cl->ok_to_begin(cl->data)) { pr_debug("Not OK to begin\n"); return -EINVAL; } batt_soc_pct = DIV_ROUND_CLOSEST(batt_soc_cp, 100); if ((cl->dt.max_start_soc != -EINVAL && Loading drivers/power/supply/qcom/fg-alg.h +1 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ struct cap_learning { bool active; struct mutex lock; struct cl_params dt; bool (*ok_to_begin)(void *data); int (*get_learned_capacity)(void *data, int64_t *learned_cap_uah); int (*store_learned_capacity)(void *data, int64_t learned_cap_uah); int (*get_cc_soc)(void *data, int *cc_soc_sw); Loading Loading
drivers/power/supply/qcom/fg-alg.c +5 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,11 @@ static int cap_learning_begin(struct cap_learning *cl, u32 batt_soc_cp) int rc, cc_soc_sw, batt_soc_pct; u32 batt_soc_prime; if (cl->ok_to_begin && !cl->ok_to_begin(cl->data)) { pr_debug("Not OK to begin\n"); return -EINVAL; } batt_soc_pct = DIV_ROUND_CLOSEST(batt_soc_cp, 100); if ((cl->dt.max_start_soc != -EINVAL && Loading
drivers/power/supply/qcom/fg-alg.h +1 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ struct cap_learning { bool active; struct mutex lock; struct cl_params dt; bool (*ok_to_begin)(void *data); int (*get_learned_capacity)(void *data, int64_t *learned_cap_uah); int (*store_learned_capacity)(void *data, int64_t learned_cap_uah); int (*get_cc_soc)(void *data, int *cc_soc_sw); Loading