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

Commit 7174c176 authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

qcom: smb-lib: disable VCONN operations for micro USB mode



VCONN is not supported in micro USB mode, thus disable
registration and operations on VCONN regulator.

While at it, disable TRY.SOURCE while disabling typeC.

CRs-Fixed: 2027962
Change-Id: Ib92564160c48f52d77815b646b4cdd5c7d23e7b3
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent 44f5f07c
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1133,6 +1133,9 @@ static int smb2_init_vconn_regulator(struct smb2 *chip)
	struct regulator_config cfg = {};
	int rc = 0;

	if (chg->micro_usb_mode)
		return 0;

	chg->vconn_vreg = devm_kzalloc(chg->dev, sizeof(*chg->vconn_vreg),
				      GFP_KERNEL);
	if (!chg->vconn_vreg)
@@ -1344,9 +1347,10 @@ static int smb2_disable_typec(struct smb_charger *chg)
	int rc;

	/* Move to typeC mode */
	/* configure FSM in idle state */
	/* configure FSM in idle state and disable UFP_ENABLE bit */
	rc = smblib_masked_write(chg, TYPE_C_INTRPT_ENB_SOFTWARE_CTRL_REG,
			TYPEC_DISABLE_CMD_BIT, TYPEC_DISABLE_CMD_BIT);
			TYPEC_DISABLE_CMD_BIT | UFP_EN_CMD_BIT,
			TYPEC_DISABLE_CMD_BIT);
	if (rc < 0) {
		dev_err(chg->dev, "Couldn't put FSM in idle rc=%d\n", rc);
		return rc;
+3 −0
Original line number Diff line number Diff line
@@ -4117,6 +4117,9 @@ static void smblib_vconn_oc_work(struct work_struct *work)
	int rc, i;
	u8 stat;

	if (chg->micro_usb_mode)
		return;

	smblib_err(chg, "over-current detected on VCONN\n");
	if (!chg->vconn_vreg || !chg->vconn_vreg->rdev)
		return;