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

Commit 9a711d9c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 45a1c634 624149c7
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;
}