Skip to content

Commit bd7c797

Browse files
xhackerustcbroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ce57bc9 commit bd7c797

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/regulator/rt5739.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#define RT5739_REG_NSEL1 0x01
2525
#define RT5739_REG_CNTL1 0x02
2626
#define RT5739_REG_ID1 0x03
27+
#define RT5739_REG_ID2 0x04
28+
#define RT5739_REG_MON 0x05
2729
#define RT5739_REG_CNTL2 0x06
2830
#define RT5739_REG_CNTL4 0x08
2931

@@ -236,11 +238,18 @@ static void rt5739_init_regulator_desc(struct regulator_desc *desc,
236238
}
237239
}
238240

241+
static bool rt5739_volatile_reg(struct device *dev, unsigned int reg)
242+
{
243+
return reg == RT5739_REG_MON;
244+
}
245+
239246
static const struct regmap_config rt5739_regmap_config = {
240247
.name = "rt5739",
241248
.reg_bits = 8,
242249
.val_bits = 8,
243250
.max_register = RT5739_REG_CNTL4,
251+
.cache_type = REGCACHE_MAPLE,
252+
.volatile_reg = rt5739_volatile_reg,
244253
};
245254

246255
static int rt5739_probe(struct i2c_client *i2c)

0 commit comments

Comments
 (0)