Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: da732x: Mark DC offset control registers volatile
@ 2014-02-24  3:00 Mark Brown
  2014-02-24 11:31 ` Opensource [Adam Thomson]
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-02-24  3:00 UTC (permalink / raw)
  To: Adam Thomson, Michal Hajduk, Liam Girdwood
  Cc: alsa-devel, linaro-kernel, stable, Mark Brown

From: Mark Brown <broonie@linaro.org>

The driver reads from the DC offset control registers during callibration
but since the registers are marked as volatile and there is a register
cache the values will not be read from the hardware after the first reading
rendering the callibration ineffective.

It appears that the driver was originally written for the ASoC level
register I/O code but converted to regmap prior to merge and this issue
was missed during the conversion as the framework level volatile register
functionality was not being used.

Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
---
 sound/soc/codecs/da732x.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
index 8e2c74d..798eb43 100644
--- a/sound/soc/codecs/da732x.c
+++ b/sound/soc/codecs/da732x.c
@@ -1268,11 +1268,23 @@ static struct snd_soc_dai_driver da732x_dai[] = {
 	},
 };
 
+static bool da732x_volatile(struct device *dev, unsigned int reg)
+{
+	switch (reg) {
+	case DA732X_REG_HPL_DAC_OFF_CNTL:
+	case DA732X_REG_HPR_DAC_OFF_CNTL:
+		return true;
+	default:
+		return false;
+	}
+}
+
 static const struct regmap_config da732x_regmap = {
 	.reg_bits		= 8,
 	.val_bits		= 8,
 
 	.max_register		= DA732X_MAX_REG,
+	.volatile_reg		= da732x_volatile,
 	.reg_defaults		= da732x_reg_cache,
 	.num_reg_defaults	= ARRAY_SIZE(da732x_reg_cache),
 	.cache_type		= REGCACHE_RBTREE,
-- 
1.9.0.rc3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-26  9:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24  3:00 [PATCH] ASoC: da732x: Mark DC offset control registers volatile Mark Brown
2014-02-24 11:31 ` Opensource [Adam Thomson]
2014-02-24 12:42   ` Mark Brown
2014-02-24 13:57     ` Opensource [Adam Thomson]
2014-02-25  1:21       ` Mark Brown
2014-02-25 16:13         ` Opensource [Adam Thomson]
2014-02-25 23:54           ` Mark Brown
2014-02-26  9:39             ` Opensource [Adam Thomson]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox