Commit 989e08c3 authored by Hsin-Yi Wang's avatar Hsin-Yi Wang Committed by Mark Brown

regulator: da9211: add cache_type

Add regmap_cache to reduce wakeups events of interrupt if regulator is
accessed frequently. This results in saving more power.
Suggested-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Signed-off-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
Acked-by: default avatarAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20200812133101.2513317-1-hsinyi@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4cf12735
......@@ -51,10 +51,24 @@ static const struct regmap_range_cfg da9211_regmap_range[] = {
},
};
static bool da9211_volatile_reg(struct device *dev, unsigned int reg)
{
switch (reg) {
case DA9211_REG_STATUS_A:
case DA9211_REG_STATUS_B:
case DA9211_REG_EVENT_A:
case DA9211_REG_EVENT_B:
return true;
}
return false;
}
static const struct regmap_config da9211_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 5 * 128,
.volatile_reg = da9211_volatile_reg,
.cache_type = REGCACHE_RBTREE,
.ranges = da9211_regmap_range,
.num_ranges = ARRAY_SIZE(da9211_regmap_range),
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment