summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/es8326.c
diff options
context:
space:
mode:
authorZhang Yi <zhangyi@everest-semi.com>2024-06-24 05:06:07 +0200
committerMark Brown <broonie@kernel.org>2024-06-24 14:38:26 +0200
commit34fa846f52f9fbef8aa262d3b39e71188e8dd884 (patch)
tree020ae826d5a1c79098f0935752eb6fe66a5e0b37 /sound/soc/codecs/es8326.c
parentASoC: codecs: ES8326: Minimize the pop noise (diff)
downloadlinux-34fa846f52f9fbef8aa262d3b39e71188e8dd884.tar.xz
linux-34fa846f52f9fbef8aa262d3b39e71188e8dd884.zip
ASoC: codecs: ES8326: regcache_sync error issue
We modified the regmap_config members to fix cach sync error. There are several registers that should be read-only registers. If these registers are written while synchronizing the register values, the codec will enter an error state.So we create es8326_writeable_register, and set these registers to false Signed-off-by: Zhang Yi <zhangyi@everest-semi.com> Link: https://patch.msgid.link/20240624030607.4307-5-zhangyi@everest-semi.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r--sound/soc/codecs/es8326.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
index 55edab04fa4b..b246694ebb4f 100644
--- a/sound/soc/codecs/es8326.c
+++ b/sound/soc/codecs/es8326.c
@@ -329,11 +329,29 @@ static bool es8326_volatile_register(struct device *dev, unsigned int reg)
}
}
+static bool es8326_writeable_register(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case ES8326_BIAS_SW1:
+ case ES8326_BIAS_SW2:
+ case ES8326_BIAS_SW3:
+ case ES8326_BIAS_SW4:
+ case ES8326_ADC_HPFS1:
+ case ES8326_ADC_HPFS2:
+ return false;
+ default:
+ return true;
+ }
+}
+
static const struct regmap_config es8326_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0xff,
+ .use_single_read = true,
+ .use_single_write = true,
.volatile_reg = es8326_volatile_register,
+ .writeable_reg = es8326_writeable_register,
.cache_type = REGCACHE_RBTREE,
};