Merge "power: qcom: smb-lib: optimize parallel current limiting with PD"
This commit is contained in:
commit
623fc3cf14
1 changed files with 5 additions and 8 deletions
|
@ -2398,16 +2398,9 @@ int smblib_get_prop_input_current_settled(struct smb_charger *chg,
|
||||||
int smblib_get_prop_input_voltage_settled(struct smb_charger *chg,
|
int smblib_get_prop_input_voltage_settled(struct smb_charger *chg,
|
||||||
union power_supply_propval *val)
|
union power_supply_propval *val)
|
||||||
{
|
{
|
||||||
const struct apsd_result *apsd_result = smblib_get_apsd_result(chg);
|
|
||||||
int rc, pulses;
|
int rc, pulses;
|
||||||
|
|
||||||
val->intval = MICRO_5V;
|
switch (chg->real_charger_type) {
|
||||||
if (apsd_result == NULL) {
|
|
||||||
smblib_err(chg, "APSD result is NULL\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (apsd_result->pst) {
|
|
||||||
case POWER_SUPPLY_TYPE_USB_HVDCP_3:
|
case POWER_SUPPLY_TYPE_USB_HVDCP_3:
|
||||||
rc = smblib_get_pulse_cnt(chg, &pulses);
|
rc = smblib_get_pulse_cnt(chg, &pulses);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
@ -2417,6 +2410,9 @@ int smblib_get_prop_input_voltage_settled(struct smb_charger *chg,
|
||||||
}
|
}
|
||||||
val->intval = MICRO_5V + HVDCP3_STEP_UV * pulses;
|
val->intval = MICRO_5V + HVDCP3_STEP_UV * pulses;
|
||||||
break;
|
break;
|
||||||
|
case POWER_SUPPLY_TYPE_USB_PD:
|
||||||
|
val->intval = chg->voltage_min_uv;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
val->intval = MICRO_5V;
|
val->intval = MICRO_5V;
|
||||||
break;
|
break;
|
||||||
|
@ -2664,6 +2660,7 @@ int smblib_set_prop_usb_voltage_min(struct smb_charger *chg,
|
||||||
}
|
}
|
||||||
|
|
||||||
chg->voltage_min_uv = min_uv;
|
chg->voltage_min_uv = min_uv;
|
||||||
|
power_supply_changed(chg->usb_main_psy);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue