Loading drivers/power/qpnp-smbcharger.c +12 −5 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ struct smbchg_chip { int usb_tl_current_ma; int dc_target_current_ma; int target_fastchg_current_ma; int cfg_fastchg_current_ma; int fastchg_current_ma; int vfloat_mv; int fastchg_current_comp; Loading Loading @@ -1559,8 +1560,7 @@ static int smbchg_sw_esr_pulse_en(struct smbchg_chip *chip, bool en) int rc; chip->sw_esr_pulse_en = en; rc = smbchg_set_fastchg_current_raw(chip, chip->target_fastchg_current_ma); rc = smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma); if (rc) return rc; rc = smbchg_parallel_usb_charging_en(chip, !en); Loading Loading @@ -1609,6 +1609,7 @@ static void smbchg_parallel_usb_disable(struct smbchg_chip *chip) power_supply_set_current_limit(parallel_psy, SUSPEND_CURRENT_MA * 1000); power_supply_set_present(parallel_psy, false); chip->target_fastchg_current_ma = chip->cfg_fastchg_current_ma; smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma); chip->usb_tl_current_ma = calc_thermal_limited_current(chip, chip->usb_target_current_ma); Loading Loading @@ -1648,8 +1649,12 @@ try_again: smbchg_parallel_usb_disable(chip); goto done; } pval.intval = 1000 * ((parallel_fcc_ma pval.intval = ((parallel_fcc_ma * PARALLEL_FCC_PERCENT_REDUCTION) / 100); pr_smb(PR_STATUS, "reducing FCC of parallel charger to %d\n", pval.intval); /* Change it to uA */ pval.intval *= 1000; parallel_psy->set_property(parallel_psy, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, &pval); /* Loading Loading @@ -1788,8 +1793,9 @@ static void smbchg_parallel_usb_enable(struct smbchg_chip *chip) goto disable_parallel; } power_supply_set_present(parallel_psy, true); smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma / 2); pval.intval = chip->target_fastchg_current_ma * 1000 / 2; chip->target_fastchg_current_ma = chip->cfg_fastchg_current_ma / 2; smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma); pval.intval = chip->target_fastchg_current_ma * 1000; parallel_psy->set_property(parallel_psy, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, &pval); smbchg_set_usb_current_max(chip, chip->parallel.current_max_ma); Loading Loading @@ -4749,6 +4755,7 @@ static int smb_parse_dt(struct smbchg_chip *chip) "parallel-usb-9v-min-current-ma", rc, 1); OF_PROP_READ(chip, chip->parallel.allowed_lowering_ma, "parallel-allowed-lowering-ma", rc, 1); chip->cfg_fastchg_current_ma = chip->target_fastchg_current_ma; if (chip->parallel.min_current_thr_ma != -EINVAL && chip->parallel.min_9v_current_thr_ma != -EINVAL) chip->parallel.avail = true; Loading Loading
drivers/power/qpnp-smbcharger.c +12 −5 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ struct smbchg_chip { int usb_tl_current_ma; int dc_target_current_ma; int target_fastchg_current_ma; int cfg_fastchg_current_ma; int fastchg_current_ma; int vfloat_mv; int fastchg_current_comp; Loading Loading @@ -1559,8 +1560,7 @@ static int smbchg_sw_esr_pulse_en(struct smbchg_chip *chip, bool en) int rc; chip->sw_esr_pulse_en = en; rc = smbchg_set_fastchg_current_raw(chip, chip->target_fastchg_current_ma); rc = smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma); if (rc) return rc; rc = smbchg_parallel_usb_charging_en(chip, !en); Loading Loading @@ -1609,6 +1609,7 @@ static void smbchg_parallel_usb_disable(struct smbchg_chip *chip) power_supply_set_current_limit(parallel_psy, SUSPEND_CURRENT_MA * 1000); power_supply_set_present(parallel_psy, false); chip->target_fastchg_current_ma = chip->cfg_fastchg_current_ma; smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma); chip->usb_tl_current_ma = calc_thermal_limited_current(chip, chip->usb_target_current_ma); Loading Loading @@ -1648,8 +1649,12 @@ try_again: smbchg_parallel_usb_disable(chip); goto done; } pval.intval = 1000 * ((parallel_fcc_ma pval.intval = ((parallel_fcc_ma * PARALLEL_FCC_PERCENT_REDUCTION) / 100); pr_smb(PR_STATUS, "reducing FCC of parallel charger to %d\n", pval.intval); /* Change it to uA */ pval.intval *= 1000; parallel_psy->set_property(parallel_psy, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, &pval); /* Loading Loading @@ -1788,8 +1793,9 @@ static void smbchg_parallel_usb_enable(struct smbchg_chip *chip) goto disable_parallel; } power_supply_set_present(parallel_psy, true); smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma / 2); pval.intval = chip->target_fastchg_current_ma * 1000 / 2; chip->target_fastchg_current_ma = chip->cfg_fastchg_current_ma / 2; smbchg_set_fastchg_current(chip, chip->target_fastchg_current_ma); pval.intval = chip->target_fastchg_current_ma * 1000; parallel_psy->set_property(parallel_psy, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, &pval); smbchg_set_usb_current_max(chip, chip->parallel.current_max_ma); Loading Loading @@ -4749,6 +4755,7 @@ static int smb_parse_dt(struct smbchg_chip *chip) "parallel-usb-9v-min-current-ma", rc, 1); OF_PROP_READ(chip, chip->parallel.allowed_lowering_ma, "parallel-allowed-lowering-ma", rc, 1); chip->cfg_fastchg_current_ma = chip->target_fastchg_current_ma; if (chip->parallel.min_current_thr_ma != -EINVAL && chip->parallel.min_9v_current_thr_ma != -EINVAL) chip->parallel.avail = true; Loading