Skip to content

Commit b402dfe

Browse files
xhackerustcbroonie
authored andcommitted
regulator: tps6287x-regulator: 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 bd7c797 commit b402dfe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/regulator/tps6287x-regulator.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@
2727
#define TPS6287X_CTRL3 0x03
2828
#define TPS6287X_STATUS 0x04
2929

30+
static bool tps6287x_volatile_reg(struct device *dev, unsigned int reg)
31+
{
32+
return reg == TPS6287X_STATUS;
33+
}
34+
3035
static const struct regmap_config tps6287x_regmap_config = {
3136
.reg_bits = 8,
3237
.val_bits = 8,
3338
.max_register = TPS6287X_STATUS,
39+
.cache_type = REGCACHE_MAPLE,
40+
.volatile_reg = tps6287x_volatile_reg,
3441
};
3542

3643
static const struct linear_range tps6287x_voltage_ranges[] = {

0 commit comments

Comments
 (0)