Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 623fc3cf authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qcom: smb-lib: optimize parallel current limiting with PD"

parents 0cae764d 4558dc0f
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -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,
						union power_supply_propval *val)
{
	const struct apsd_result *apsd_result = smblib_get_apsd_result(chg);
	int rc, pulses;

	val->intval = MICRO_5V;
	if (apsd_result == NULL) {
		smblib_err(chg, "APSD result is NULL\n");
		return 0;
	}

	switch (apsd_result->pst) {
	switch (chg->real_charger_type) {
	case POWER_SUPPLY_TYPE_USB_HVDCP_3:
		rc = smblib_get_pulse_cnt(chg, &pulses);
		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;
		break;
	case POWER_SUPPLY_TYPE_USB_PD:
		val->intval = chg->voltage_min_uv;
		break;
	default:
		val->intval = MICRO_5V;
		break;
@@ -2664,6 +2660,7 @@ int smblib_set_prop_usb_voltage_min(struct smb_charger *chg,
	}

	chg->voltage_min_uv = min_uv;
	power_supply_changed(chg->usb_main_psy);
	return rc;
}