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

Commit f7627505 authored by Harry Yang's avatar Harry Yang
Browse files

power: smb138x: enable interrupt sources for usb-src-change irq



By default, usb-src-change irq will not be triggered because none of
the interrupt sources is enabled.

Enable APSD completion, HVDCP detection, authentication and adapter
voltage change as irq sources.

This is needed for smb138x as standalone charger.

Change-Id: If8bed10b25f03695aeca3a6083772b75ceff3f96
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 2c731470
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1106,6 +1106,17 @@ static int smb138x_init_hw(struct smb138x *chip)
		return rc;
	}

	/* enable usb-src-change interrupt sources */
	rc = smblib_masked_write(chg, USBIN_SOURCE_CHANGE_INTRPT_ENB_REG,
				APSD_IRQ_EN_CFG_BIT | HVDCP_IRQ_EN_CFG_BIT
			      | AUTH_IRQ_EN_CFG_BIT | VADP_IRQ_EN_CFG_BIT,
				APSD_IRQ_EN_CFG_BIT | HVDCP_IRQ_EN_CFG_BIT
			      | AUTH_IRQ_EN_CFG_BIT | VADP_IRQ_EN_CFG_BIT);
	if (rc < 0) {
		pr_err("Couldn't configure Type-C interrupts rc=%d\n", rc);
		return rc;
	}

	/* configure to a fixed 700khz freq to avoid tdie errors */
	rc = smblib_set_charge_param(chg, &chg->param.freq_buck, 700);
	if (rc < 0) {