From 0172172434a4de66f94e1dcb47ce3f7a880b51ad Mon Sep 17 00:00:00 2001 From: Essential kernel team Date: Wed, 25 Oct 2017 15:22:33 +0800 Subject: [PATCH] Fix bugs about step-chg-jeita 1. JEITA FV compensation cannot work 2. Cannot charge when battery capacity is 0% 3. Wrong debug message Change-Id: I32ecb77b4c1dd8073cbf5aec070c3e6fcadc1dd2 --- drivers/power/supply/qcom/battery.c | 2 +- drivers/power/supply/qcom/step-chg-jeita.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/qcom/battery.c b/drivers/power/supply/qcom/battery.c index 63d201b7be9d..bae0fff3edf8 100644 --- a/drivers/power/supply/qcom/battery.c +++ b/drivers/power/supply/qcom/battery.c @@ -1361,7 +1361,7 @@ int qcom_batt_init(void) goto release_wakeup_source; } - chip->fv_votable = create_votable("FV", VOTE_MAX, + chip->fv_votable = create_votable("FV", VOTE_MIN, pl_fv_vote_callback, chip); if (IS_ERR(chip->fv_votable)) { diff --git a/drivers/power/supply/qcom/step-chg-jeita.c b/drivers/power/supply/qcom/step-chg-jeita.c index acc0d772d44d..f6b7be5ba094 100644 --- a/drivers/power/supply/qcom/step-chg-jeita.c +++ b/drivers/power/supply/qcom/step-chg-jeita.c @@ -164,6 +164,7 @@ static int get_val(struct range_data *range, int hysteresis, int current_index, range[i].high_threshold, threshold)) { *new_index = i; *val = range[i].value; + break; } /* if nothing was found, return -ENODATA */ @@ -337,7 +338,7 @@ static int handle_jeita(struct step_chg_info *chip) vote(chip->fv_votable, JEITA_VOTER, true, fv_uv); pr_debug("%s = %d FCC = %duA FV = %duV\n", - step_chg_config.prop_name, pval.intval, fcc_ua, fv_uv); + jeita_fv_config.prop_name, pval.intval, fcc_ua, fv_uv); update_time: chip->jeita_last_update_time = ktime_get();