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

Commit 635dca1f authored by Nicholas Troast's avatar Nicholas Troast
Browse files

smb-lib: fix unknown APSD result after CC2 workaround



If APSD is triggered while APSD is disabled the APSD_RESULT_STATUS
register will be reset. APSD will trigger whenever both VBUS and CC
have been debounced. This includes when VBUS is stable and CC is
re-asserted.

This is an issue particularly when the CC2 workaround re-asserts CC
when PD performs a hard reset since APSD will be disabled.

Fix this by configuring APSD to trigger only on VBUS before CC is
re-asserted by the CC2 workaround.

Change-Id: I507646faaab7aafeedb4104ad0ad5c32970270a6
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 314869eb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2314,6 +2314,12 @@ int smblib_reg_block_restore(struct smb_charger *chg,
}

static struct reg_info cc2_detach_settings[] = {
	{
		.reg	= TYPE_C_CFG_REG,
		.mask	= APSD_START_ON_CC_BIT,
		.val	= 0,
		.desc	= "TYPE_C_CFG_REG",
	},
	{
		.reg	= TYPE_C_CFG_2_REG,
		.mask	= TYPE_C_UFP_MODE_BIT | EN_TRY_SOURCE_MODE_BIT,