Skip to content

Commit 427ceac

Browse files
xhackerustcbroonie
authored andcommitted
regulator: tps6286x-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 b402dfe commit 427ceac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/regulator/tps6286x-regulator.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
#define TPS6286X_CONTROL_FPWM BIT(4)
2020
#define TPS6286X_CONTROL_SWEN BIT(5)
2121

22+
#define TPS6286X_STATUS 0x05
23+
2224
#define TPS6286X_MIN_MV 400
2325
#define TPS6286X_MAX_MV 1675
2426
#define TPS6286X_STEP_MV 5
2527

28+
static bool tps6287x_volatile_reg(struct device *dev, unsigned int reg)
29+
{
30+
return reg == TPS6286X_STATUS;
31+
}
32+
2633
static const struct regmap_config tps6286x_regmap_config = {
2734
.reg_bits = 8,
2835
.val_bits = 8,
36+
.cache_type = REGCACHE_MAPLE,
37+
.volatile_reg = tps6287x_volatile_reg,
2938
};
3039

3140
static int tps6286x_set_mode(struct regulator_dev *rdev, unsigned int mode)

0 commit comments

Comments
 (0)