power: smb1398: Do not disable FP_FET during IREV condition

Allow the charger to recover after a momentary IREV condition
by using the configuration-bit to not-disable FP-FET in IREV.

Change-Id: I22cad3bbc4bde0a143e3ff6e068e750a2c40e34b
Signed-off-by: Ashish Chavan <ashichav@codeaurora.org>
This commit is contained in:
Ashish Chavan 2020-07-17 14:11:37 +05:30 • committed by Gerrit - the friendly Code Review server
commit a4f06c51fc

View file

@ -92,6 +92,7 @@
#define MISC_CFG0_REG 0x2634
#define DIS_SYNC_DRV_BIT BIT(5)
#define SW_EN_SWITCHER_BIT BIT(3)
#define CFG_DIS_FPF_IREV_BIT BIT(1)
#define MISC_CFG1_REG 0x2635
#define MISC_CFG1_MASK GENMASK(7, 0)
@ -1985,6 +1986,14 @@ static int smb1398_div2_cp_hw_init(struct smb1398_chip *chip)
return rc;
}
/* Do not disable FP_FET during IREV conditions */
rc = smb1398_masked_write(chip, MISC_CFG0_REG, CFG_DIS_FPF_IREV_BIT, 0);
if (rc < 0) {
dev_err(chip->dev, "Couldn't set CFG_DIS_FPF_IREV_BIT, rc=%d\n",
rc);
return rc;
}
/* switcher enable controlled by register */
rc = smb1398_masked_write(chip, MISC_CFG0_REG,
SW_EN_SWITCHER_BIT, SW_EN_SWITCHER_BIT);