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

regulator: rt5739: Enable REGCACHE_MAPLE

Enable regmap cache to reduce i2c transactions and corresponding
interrupts if regulator is accessed frequently.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20250629094803.776-1-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jisheng Zhang and committed by
Mark Brown
bd7c7976 ce57bc97

+9
+9
drivers/regulator/rt5739.c
··· 24 24 #define RT5739_REG_NSEL1 0x01 25 25 #define RT5739_REG_CNTL1 0x02 26 26 #define RT5739_REG_ID1 0x03 27 + #define RT5739_REG_ID2 0x04 28 + #define RT5739_REG_MON 0x05 27 29 #define RT5739_REG_CNTL2 0x06 28 30 #define RT5739_REG_CNTL4 0x08 29 31 ··· 238 236 } 239 237 } 240 238 239 + static bool rt5739_volatile_reg(struct device *dev, unsigned int reg) 240 + { 241 + return reg == RT5739_REG_MON; 242 + } 243 + 241 244 static const struct regmap_config rt5739_regmap_config = { 242 245 .name = "rt5739", 243 246 .reg_bits = 8, 244 247 .val_bits = 8, 245 248 .max_register = RT5739_REG_CNTL4, 249 + .cache_type = REGCACHE_MAPLE, 250 + .volatile_reg = rt5739_volatile_reg, 246 251 }; 247 252 248 253 static int rt5739_probe(struct i2c_client *i2c)