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

Commit 18a5c301 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Anirudh Ghayal
Browse files

power: smb-lib: enable DPDM regulator at CC attach



In case of quick back-to-back  insertion/removal of USB
there is a possibility that VBUS does not fall below the
1V usb-plugout threshold and hence the subsequent insertion
does not generate a plug-in event. This keeps the DPDM
regulator disabled at insertion thus impacting the APSD result.

Fix this by voting to enable the DPDM regulator in the cc-attach
handler.

CRs-Fixed: 2042071
Change-Id: I37a32081f0847965e34eb1c4114602ec61e9a005
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent d1b4aa23
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3841,11 +3841,15 @@ static void smblib_handle_typec_insertion(struct smb_charger *chg)
		smblib_err(chg, "Couldn't disable APSD_START_ON_CC rc=%d\n",
									rc);

	if (chg->typec_status[3] & UFP_DFP_MODE_STATUS_BIT)
	if (chg->typec_status[3] & UFP_DFP_MODE_STATUS_BIT) {
		typec_sink_insertion(chg);
	else
	} else {
		/* vote to the USB stack to float DP_DM before APSD */
		power_supply_set_dp_dm(chg->usb_psy,
					POWER_SUPPLY_DP_DM_DPF_DMF);
		typec_sink_removal(chg);
	}
}

static void smblib_handle_rp_change(struct smb_charger *chg, int typec_mode)
{