Loading drivers/power/supply/qcom/step-chg-jeita.c +5 −26 Original line number Diff line number Diff line Loading @@ -541,8 +541,9 @@ static int handle_step_chg_config(struct step_chg_info *chip) u64 elapsed_us; elapsed_us = ktime_us_delta(ktime_get(), chip->step_last_update_time); /* skip processing, event too early */ if (elapsed_us < STEP_CHG_HYSTERISIS_DELAY_US) goto reschedule; return 0; rc = power_supply_get_property(chip->batt_psy, POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED, &pval); Loading Loading @@ -612,10 +613,6 @@ static int handle_step_chg_config(struct step_chg_info *chip) update_time: chip->step_last_update_time = ktime_get(); return 0; reschedule: /* reschedule 1000uS after the remaining time */ return (STEP_CHG_HYSTERISIS_DELAY_US - elapsed_us + 1000); } #define JEITA_SUSPEND_HYST_UV 50000 Loading Loading @@ -643,8 +640,9 @@ static int handle_jeita(struct step_chg_info *chip) } elapsed_us = ktime_us_delta(ktime_get(), chip->jeita_last_update_time); /* skip processing, event too early */ if (elapsed_us < STEP_CHG_HYSTERISIS_DELAY_US) goto reschedule; return 0; if (chip->jeita_fcc_config->param.use_bms) rc = power_supply_get_property(chip->bms_psy, Loading Loading @@ -731,10 +729,6 @@ static int handle_jeita(struct step_chg_info *chip) power_supply_changed(chip->main_psy); return 0; reschedule: /* reschedule 1000uS after the remaining time */ return (STEP_CHG_HYSTERISIS_DELAY_US - elapsed_us + 1000); } static int handle_battery_insertion(struct step_chg_info *chip) Loading Loading @@ -775,9 +769,6 @@ static void status_change_work(struct work_struct *work) struct step_chg_info *chip = container_of(work, struct step_chg_info, status_change_work.work); int rc = 0; int reschedule_us; int reschedule_jeita_work_us = 0; int reschedule_step_work_us = 0; union power_supply_propval prop = {0, }; if (!is_batt_available(chip) || !is_bms_available(chip)) Loading @@ -787,14 +778,10 @@ static void status_change_work(struct work_struct *work) /* skip elapsed_us debounce for handling battery temperature */ rc = handle_jeita(chip); if (rc > 0) reschedule_jeita_work_us = rc; else if (rc < 0) if (rc < 0) pr_err("Couldn't handle sw jeita rc = %d\n", rc); rc = handle_step_chg_config(chip); if (rc > 0) reschedule_step_work_us = rc; if (rc < 0) pr_err("Couldn't handle step rc = %d\n", rc); Loading @@ -810,14 +797,6 @@ static void status_change_work(struct work_struct *work) } } reschedule_us = min(reschedule_jeita_work_us, reschedule_step_work_us); if (reschedule_us == 0) goto exit_work; else schedule_delayed_work(&chip->status_change_work, usecs_to_jiffies(reschedule_us)); return; exit_work: __pm_relax(chip->step_chg_ws); } Loading Loading
drivers/power/supply/qcom/step-chg-jeita.c +5 −26 Original line number Diff line number Diff line Loading @@ -541,8 +541,9 @@ static int handle_step_chg_config(struct step_chg_info *chip) u64 elapsed_us; elapsed_us = ktime_us_delta(ktime_get(), chip->step_last_update_time); /* skip processing, event too early */ if (elapsed_us < STEP_CHG_HYSTERISIS_DELAY_US) goto reschedule; return 0; rc = power_supply_get_property(chip->batt_psy, POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED, &pval); Loading Loading @@ -612,10 +613,6 @@ static int handle_step_chg_config(struct step_chg_info *chip) update_time: chip->step_last_update_time = ktime_get(); return 0; reschedule: /* reschedule 1000uS after the remaining time */ return (STEP_CHG_HYSTERISIS_DELAY_US - elapsed_us + 1000); } #define JEITA_SUSPEND_HYST_UV 50000 Loading Loading @@ -643,8 +640,9 @@ static int handle_jeita(struct step_chg_info *chip) } elapsed_us = ktime_us_delta(ktime_get(), chip->jeita_last_update_time); /* skip processing, event too early */ if (elapsed_us < STEP_CHG_HYSTERISIS_DELAY_US) goto reschedule; return 0; if (chip->jeita_fcc_config->param.use_bms) rc = power_supply_get_property(chip->bms_psy, Loading Loading @@ -731,10 +729,6 @@ static int handle_jeita(struct step_chg_info *chip) power_supply_changed(chip->main_psy); return 0; reschedule: /* reschedule 1000uS after the remaining time */ return (STEP_CHG_HYSTERISIS_DELAY_US - elapsed_us + 1000); } static int handle_battery_insertion(struct step_chg_info *chip) Loading Loading @@ -775,9 +769,6 @@ static void status_change_work(struct work_struct *work) struct step_chg_info *chip = container_of(work, struct step_chg_info, status_change_work.work); int rc = 0; int reschedule_us; int reschedule_jeita_work_us = 0; int reschedule_step_work_us = 0; union power_supply_propval prop = {0, }; if (!is_batt_available(chip) || !is_bms_available(chip)) Loading @@ -787,14 +778,10 @@ static void status_change_work(struct work_struct *work) /* skip elapsed_us debounce for handling battery temperature */ rc = handle_jeita(chip); if (rc > 0) reschedule_jeita_work_us = rc; else if (rc < 0) if (rc < 0) pr_err("Couldn't handle sw jeita rc = %d\n", rc); rc = handle_step_chg_config(chip); if (rc > 0) reschedule_step_work_us = rc; if (rc < 0) pr_err("Couldn't handle step rc = %d\n", rc); Loading @@ -810,14 +797,6 @@ static void status_change_work(struct work_struct *work) } } reschedule_us = min(reschedule_jeita_work_us, reschedule_step_work_us); if (reschedule_us == 0) goto exit_work; else schedule_delayed_work(&chip->status_change_work, usecs_to_jiffies(reschedule_us)); return; exit_work: __pm_relax(chip->step_chg_ws); } Loading