Skip to content

Commit 98b94b6

Browse files
fschrempfbroonie
authored andcommitted
regulator: pca9450: Clear PRESET_EN bit to fix BUCK1/2/3 voltage setting
The driver uses the DVS registers PCA9450_REG_BUCKxOUT_DVS0 to set the voltage for the buck regulators 1, 2 and 3. This has no effect as the PRESET_EN bit is set by default and therefore the preset values are used instead, which are set to 850 mV. To fix this we clear the PRESET_EN bit at time of initialization. Fixes: 0935ff5 ("regulator: pca9450: add pca9450 pmic driver") Cc: <stable@vger.kernel.org> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20210222115229.166620-1-frieder.schrempf@kontron.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent dfe03bc commit 98b94b6

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/regulator/pca9450-regulator.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
797797
return ret;
798798
}
799799

800+
/* Clear PRESET_EN bit in BUCK123_DVS to use DVS registers */
801+
ret = regmap_clear_bits(pca9450->regmap, PCA9450_REG_BUCK123_DVS,
802+
BUCK123_PRESET_EN);
803+
if (ret) {
804+
dev_err(&i2c->dev, "Failed to clear PRESET_EN bit: %d\n", ret);
805+
return ret;
806+
}
807+
800808
/* Set reset behavior on assertion of WDOG_B signal */
801809
ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL,
802810
WDOG_B_CFG_MASK, WDOG_B_CFG_COLD_LDO12);

include/linux/regulator/pca9450.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ enum {
147147
#define BUCK6_FPWM 0x04
148148
#define BUCK6_ENMODE_MASK 0x03
149149

150+
/* PCA9450_REG_BUCK123_PRESET_EN bit */
151+
#define BUCK123_PRESET_EN 0x80
152+
150153
/* PCA9450_BUCK1OUT_DVS0 bits */
151154
#define BUCK1OUT_DVS0_MASK 0x7F
152155
#define BUCK1OUT_DVS0_DEFAULT 0x14

0 commit comments

Comments
 (0)