aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/es8316.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-04-19 19:45:06 +0100
committerMark Brown <broonie@kernel.org>2023-04-20 12:52:03 +0100
commit2cc3fdcddc86644c070223c522e418416cb7b1a2 (patch)
treef4d8e75f474104080cb98baa929fa3435a2dc682 /sound/soc/codecs/es8316.c
parentASoC: SOF: Intel: Split the set_power_op for IPC3 and IPC4 (diff)
downloadlinux-stable-2cc3fdcddc86644c070223c522e418416cb7b1a2.tar.xz
linux-stable-2cc3fdcddc86644c070223c522e418416cb7b1a2.zip
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: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230419-asoc-es8316-volatile-v1-1-2074ec93d8f1@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/es8316.c')
-rw-r--r--sound/soc/codecs/es8316.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index f7d7a9c91e04..a27d80956459 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -803,14 +803,15 @@ static const struct snd_soc_component_driver soc_component_dev_es8316 = {
.endianness = 1,
};
-static const struct regmap_range es8316_volatile_ranges[] = {
- regmap_reg_range(ES8316_GPIO_FLAG, ES8316_GPIO_FLAG),
-};
-
-static const struct regmap_access_table es8316_volatile_table = {
- .yes_ranges = es8316_volatile_ranges,
- .n_yes_ranges = ARRAY_SIZE(es8316_volatile_ranges),
-};
+static bool es8316_volatile_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case ES8316_GPIO_FLAG:
+ return true;
+ default:
+ return false;
+ }
+}
static const struct regmap_config es8316_regmap = {
.reg_bits = 8,
@@ -818,7 +819,7 @@ static const struct regmap_config es8316_regmap = {
.use_single_read = true,
.use_single_write = true,
.max_register = 0x53,
- .volatile_table = &es8316_volatile_table,
+ .volatile_reg = es8316_volatile_reg,
.cache_type = REGCACHE_RBTREE,
};