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

Commit a6712ea7 authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

power: smb5-lib: generate power supply event for PD current change



Generate power supply event to notify all clients whenever PD driver
request for a change in the max current.

Change-Id: Iaf4147de49b72dd4a82d596c6ff81fdbb565d37a
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent fc596f63
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -3912,12 +3912,16 @@ static int get_rp_based_dcp_current(struct smb_charger *chg, int typec_mode)
int smblib_set_prop_pd_current_max(struct smb_charger *chg,
				    const union power_supply_propval *val)
{
	int rc;
	int rc, icl;

	if (chg->pd_active)
	if (chg->pd_active) {
		icl = get_client_vote(chg->usb_icl_votable, PD_VOTER);
		rc = vote(chg->usb_icl_votable, PD_VOTER, true, val->intval);
	else
		if (val->intval != icl)
			power_supply_changed(chg->usb_psy);
	} else {
		rc = -EPERM;
	}

	return rc;
}