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

Commit 338cc814 authored by Harry Yang's avatar Harry Yang Committed by Kyle Yan
Browse files

qcom-charger: qpnp-smb2: update usb type on PD_ACTIVE



There is a race condition between setting PD_ACTIVE = 0 and when losing CC.
If PD_ACTIVE is not set to 0 by the time the TYPE_C interrupt fires on
disconnect then the POWER_SUPPLY_TYPE will not be set to UNKNOWN.

Instead of relying on PD_ACTIVE being set to 0 before the TYPE_C interrupt
fires, just update the type upon PD_ACTIVE being set.

CRs-Fixed: 1017798
Change-Id: Icd62b9d98d5763d209c7de897653f19f8031e236
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent fd7c4dad
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1031,6 +1031,7 @@ int smblib_set_prop_pd_active(struct smb_charger *chg,
	vote(chg->pd_allowed_votable, PD_VOTER, val->intval, 0);

	chg->pd_active = (bool)val->intval;
	smblib_update_usb_type(chg);
	return rc;
}