Commit 2cc3fdcd authored by Mark Brown's avatar Mark Brown

ASoC: es8316: Don't use ranges based register lookup for a single register

The es8316 driver uses a register range to specify the single volatile
register it has. While the cost will be in the noise this is a bunch of
overhead compared to just having a volatile_reg() callback so switch to
the callback.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230419-asoc-es8316-volatile-v1-1-2074ec93d8f1@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 996b07ef
...@@ -803,14 +803,15 @@ static const struct snd_soc_component_driver soc_component_dev_es8316 = { ...@@ -803,14 +803,15 @@ static const struct snd_soc_component_driver soc_component_dev_es8316 = {
.endianness = 1, .endianness = 1,
}; };
static const struct regmap_range es8316_volatile_ranges[] = { static bool es8316_volatile_reg(struct device *dev, unsigned int reg)
regmap_reg_range(ES8316_GPIO_FLAG, ES8316_GPIO_FLAG), {
}; switch (reg) {
case ES8316_GPIO_FLAG:
static const struct regmap_access_table es8316_volatile_table = { return true;
.yes_ranges = es8316_volatile_ranges, default:
.n_yes_ranges = ARRAY_SIZE(es8316_volatile_ranges), return false;
}; }
}
static const struct regmap_config es8316_regmap = { static const struct regmap_config es8316_regmap = {
.reg_bits = 8, .reg_bits = 8,
...@@ -818,7 +819,7 @@ static const struct regmap_config es8316_regmap = { ...@@ -818,7 +819,7 @@ static const struct regmap_config es8316_regmap = {
.use_single_read = true, .use_single_read = true,
.use_single_write = true, .use_single_write = true,
.max_register = 0x53, .max_register = 0x53,
.volatile_table = &es8316_volatile_table, .volatile_reg = es8316_volatile_reg,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
......
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