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

Commit 624149c7 authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

power: smb5: Revoke USB_PSY_VOTER's vote if not USB-PD



If USB PHY fails to detect a valid USB-PD device (after three
consecutive hard resets), revoke USB_PSY_VOTER's low vote of 100 mA so
that the ICL may rise to 3 A based on the Rp of the Type-C cable.

Change-Id: Ie22cc8fb43a9af815ebe865bb43afef83d57f10c
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 17724c00
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -4515,7 +4515,7 @@ int smblib_set_prop_pd_active(struct smb_charger *chg,
	const struct apsd_result *apsd = smblib_get_apsd_result(chg);

	int rc = 0;
	int sec_charger;
	int sec_charger, typec_mode;

	/*
	 * Ignore repetitive notification while PD is active, which
@@ -4585,6 +4585,14 @@ int smblib_set_prop_pd_active(struct smb_charger *chg,
	smblib_usb_pd_adapter_allowance_override(chg,
			!!chg->pd_active ? FORCE_5V : FORCE_NULL);
	smblib_update_usb_type(chg);

	if (chg->real_charger_type == POWER_SUPPLY_TYPE_USB &&
			!chg->ok_to_pd) {
		typec_mode = smblib_get_prop_typec_mode(chg);
		if (typec_rp_med_high(chg, typec_mode))
			vote(chg->usb_icl_votable, USB_PSY_VOTER, false, 0);
	}

	power_supply_changed(chg->usb_psy);
	return rc;
}