diff mbox

[2/6] ASoC: adau17x1: Mark DSP parameter memory as readable and precious

Message ID 1416418148-14803-2-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Commit dee9cec42fc9cc4635ea2f45939e443210a638f8
Headers show

Commit Message

Lars-Peter Clausen Nov. 19, 2014, 5:29 p.m. UTC
To be able to read back data from the DSP parameter memory the register
range needs to be marked as readable. At the same time we do not want them
to e.g. appear in debugfs output so mark them as precious as well.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/codecs/adau1761.c |  1 +
 sound/soc/codecs/adau1781.c |  1 +
 sound/soc/codecs/adau17x1.c | 14 ++++++++++++++
 sound/soc/codecs/adau17x1.h |  1 +
 4 files changed, 17 insertions(+)

Comments

Lars-Peter Clausen Nov. 21, 2014, 4:30 p.m. UTC | #1
On 11/19/2014 06:29 PM, Lars-Peter Clausen wrote:
> To be able to read back data from the DSP parameter memory the register
> range needs to be marked as readable. At the same time we do not want them
> to e.g. appear in debugfs output so mark them as precious as well.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>


It looks like this one was lost, shall I resend?

Thanks,
- Lars
Mark Brown Nov. 21, 2014, 4:38 p.m. UTC | #2
On Fri, Nov 21, 2014 at 05:30:30PM +0100, Lars-Peter Clausen wrote:

> It looks like this one was lost, shall I resend?

Yes.
diff mbox

Patch

diff --git a/sound/soc/codecs/adau1761.c b/sound/soc/codecs/adau1761.c
index 16093dc..d4c0fd7 100644
--- a/sound/soc/codecs/adau1761.c
+++ b/sound/soc/codecs/adau1761.c
@@ -799,6 +799,7 @@  const struct regmap_config adau1761_regmap_config = {
 	.num_reg_defaults = ARRAY_SIZE(adau1761_reg_defaults),
 	.readable_reg = adau1761_readable_register,
 	.volatile_reg = adau17x1_volatile_register,
+	.precious_reg = adau17x1_precious_register,
 	.cache_type = REGCACHE_RBTREE,
 };
 EXPORT_SYMBOL_GPL(adau1761_regmap_config);
diff --git a/sound/soc/codecs/adau1781.c b/sound/soc/codecs/adau1781.c
index aa6a37c..c4dab80 100644
--- a/sound/soc/codecs/adau1781.c
+++ b/sound/soc/codecs/adau1781.c
@@ -488,6 +488,7 @@  const struct regmap_config adau1781_regmap_config = {
 	.num_reg_defaults	= ARRAY_SIZE(adau1781_reg_defaults),
 	.readable_reg		= adau1781_readable_register,
 	.volatile_reg		= adau17x1_volatile_register,
+	.precious_reg		= adau17x1_precious_register,
 	.cache_type		= REGCACHE_RBTREE,
 };
 EXPORT_SYMBOL_GPL(adau1781_regmap_config);
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 427ad77..c56420c 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -688,8 +688,22 @@  int adau17x1_set_micbias_voltage(struct snd_soc_codec *codec,
 }
 EXPORT_SYMBOL_GPL(adau17x1_set_micbias_voltage);
 
+bool adau17x1_precious_register(struct device *dev, unsigned int reg)
+{
+	/* SigmaDSP parameter memory */
+	if (reg < 0x400)
+		return true;
+
+	return false;
+}
+EXPORT_SYMBOL_GPL(adau17x1_precious_register);
+
 bool adau17x1_readable_register(struct device *dev, unsigned int reg)
 {
+	/* SigmaDSP parameter memory */
+	if (reg < 0x400)
+		return true;
+
 	switch (reg) {
 	case ADAU17X1_CLOCK_CONTROL:
 	case ADAU17X1_PLL_CONTROL:
diff --git a/sound/soc/codecs/adau17x1.h b/sound/soc/codecs/adau17x1.h
index e4a557f..870cd32 100644
--- a/sound/soc/codecs/adau17x1.h
+++ b/sound/soc/codecs/adau17x1.h
@@ -52,6 +52,7 @@  int adau17x1_set_micbias_voltage(struct snd_soc_codec *codec,
 	enum adau17x1_micbias_voltage micbias);
 bool adau17x1_readable_register(struct device *dev, unsigned int reg);
 bool adau17x1_volatile_register(struct device *dev, unsigned int reg);
+bool adau17x1_precious_register(struct device *dev, unsigned int reg);
 int adau17x1_resume(struct snd_soc_codec *codec);
 
 extern const struct snd_soc_dai_ops adau17x1_dai_ops;