Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: pca9450: Make I2C Level Translator configurable

Make the I2C Level Translator included in PCA9450 configurable from
devicetree. The reset state is off. By setting nxp,i2c-lt-enable, the
I2C Level Translator will be enabled while in STANDBY or RUN state.

Signed-off-by: Per-Daniel Olsson <perdo@axis.com>
Signed-off-by: Rickard x Andersson <rickaran@axis.com>
Link: https://lore.kernel.org/r/20220429072211.24957-2-rickaran@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Per-Daniel Olsson and committed by
Mark Brown
62139f52 e721b161

+18
+11
drivers/regulator/pca9450-regulator.c
··· 810 810 return ret; 811 811 } 812 812 813 + if (of_property_read_bool(i2c->dev.of_node, "nxp,i2c-lt-enable")) { 814 + /* Enable I2C Level Translator */ 815 + ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_CONFIG2, 816 + I2C_LT_MASK, I2C_LT_ON_STANDBY_RUN); 817 + if (ret) { 818 + dev_err(&i2c->dev, 819 + "Failed to enable I2C level translator\n"); 820 + return ret; 821 + } 822 + } 823 + 813 824 /* 814 825 * The driver uses the LDO5CTRL_H register to control the LDO5 regulator. 815 826 * This is only valid if the SD_VSEL input of the PMIC is high. Let's
+7
include/linux/regulator/pca9450.h
··· 226 226 #define WDOG_B_CFG_COLD_LDO12 0x80 227 227 #define WDOG_B_CFG_COLD 0xC0 228 228 229 + /* PCA9450_REG_CONFIG2 bits */ 230 + #define I2C_LT_MASK 0x03 231 + #define I2C_LT_FORCE_DISABLE 0x00 232 + #define I2C_LT_ON_STANDBY_RUN 0x01 233 + #define I2C_LT_ON_RUN 0x02 234 + #define I2C_LT_FORCE_ENABLE 0x03 235 + 229 236 #endif /* __LINUX_REG_PCA9450_H__ */