power: smb5: Disable unused rid change interrupt sources
Fixes issue where system can't enter VDD minimization.
Issue: FP3-A11#230
Change-Id: Ia4e733a80cb29cb8f2d3507b91eb0a87e52c7313
(cherry picked from commit 5c010f118669e4b14e2baa532193b3cff486244e)
diff --git a/drivers/power/supply/qcom/qpnp-smb5.c b/drivers/power/supply/qcom/qpnp-smb5.c
index 3183f69..27e06740 100755
--- a/drivers/power/supply/qcom/qpnp-smb5.c
+++ b/drivers/power/supply/qcom/qpnp-smb5.c
@@ -1684,7 +1684,7 @@
static int smb5_configure_typec(struct smb_charger *chg)
{
int rc;
- u8 val = 0;
+ u8 val = 0, rid_int_src = 0;
rc = smblib_read(chg, LEGACY_CABLE_STATUS_REG, &val);
if (rc < 0) {
@@ -1750,6 +1750,16 @@
rc);
return rc;
}
+
+ /* Enable Water detection rid source interrupt */
+ rid_int_src |= TYPEC_WATER_DETECTION_INT_EN_BIT;
+ }
+
+ /* Disable rid source interrupts which are not required. */
+ rc = smblib_write(chg, TYPE_C_INTERRUPT_EN_CFG_2_REG, rid_int_src);
+ if (rc < 0) {
+ dev_err(chg->dev, "Couldn't configure Type-C interrupts rc=%d\n", rc);
+ return rc;
}
/* Disable TypeC and RID change source interrupts */