aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-21 12:53:51 -0500
committerMark Brown <broonie@kernel.org>2014-11-21 13:17:50 -0500
commitdee9cec42fc9cc4635ea2f45939e443210a638f8 (patch)
tree4dc001051580be8355f678f64879d0242c39cd63
parenta3a1ec66d6c9320e676fc99dbaf18db4f8dcda93 (diff)
ASoC: adau17x1: Mark DSP parameter memory as readable and precious
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> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/adau1761.c1
-rw-r--r--sound/soc/codecs/adau1781.c1
-rw-r--r--sound/soc/codecs/adau17x1.c14
-rw-r--r--sound/soc/codecs/adau17x1.h1
4 files changed, 17 insertions, 0 deletions
diff --git a/sound/soc/codecs/adau1761.c b/sound/soc/codecs/adau1761.c
index 0ae1501f3c11..4c018c575b01 100644
--- a/sound/soc/codecs/adau1761.c
+++ b/sound/soc/codecs/adau1761.c
@@ -793,6 +793,7 @@ const struct regmap_config adau1761_regmap_config = {
793 .num_reg_defaults = ARRAY_SIZE(adau1761_reg_defaults), 793 .num_reg_defaults = ARRAY_SIZE(adau1761_reg_defaults),
794 .readable_reg = adau1761_readable_register, 794 .readable_reg = adau1761_readable_register,
795 .volatile_reg = adau17x1_volatile_register, 795 .volatile_reg = adau17x1_volatile_register,
796 .precious_reg = adau17x1_precious_register,
796 .cache_type = REGCACHE_RBTREE, 797 .cache_type = REGCACHE_RBTREE,
797}; 798};
798EXPORT_SYMBOL_GPL(adau1761_regmap_config); 799EXPORT_SYMBOL_GPL(adau1761_regmap_config);
diff --git a/sound/soc/codecs/adau1781.c b/sound/soc/codecs/adau1781.c
index 4c8ddc3c69e1..926fc99c1dda 100644
--- a/sound/soc/codecs/adau1781.c
+++ b/sound/soc/codecs/adau1781.c
@@ -472,6 +472,7 @@ const struct regmap_config adau1781_regmap_config = {
472 .num_reg_defaults = ARRAY_SIZE(adau1781_reg_defaults), 472 .num_reg_defaults = ARRAY_SIZE(adau1781_reg_defaults),
473 .readable_reg = adau1781_readable_register, 473 .readable_reg = adau1781_readable_register,
474 .volatile_reg = adau17x1_volatile_register, 474 .volatile_reg = adau17x1_volatile_register,
475 .precious_reg = adau17x1_precious_register,
475 .cache_type = REGCACHE_RBTREE, 476 .cache_type = REGCACHE_RBTREE,
476}; 477};
477EXPORT_SYMBOL_GPL(adau1781_regmap_config); 478EXPORT_SYMBOL_GPL(adau1781_regmap_config);
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 1cab34c57413..50000477dc2a 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -706,8 +706,22 @@ int adau17x1_set_micbias_voltage(struct snd_soc_codec *codec,
706} 706}
707EXPORT_SYMBOL_GPL(adau17x1_set_micbias_voltage); 707EXPORT_SYMBOL_GPL(adau17x1_set_micbias_voltage);
708 708
709bool adau17x1_precious_register(struct device *dev, unsigned int reg)
710{
711 /* SigmaDSP parameter memory */
712 if (reg < 0x400)
713 return true;
714
715 return false;
716}
717EXPORT_SYMBOL_GPL(adau17x1_precious_register);
718
709bool adau17x1_readable_register(struct device *dev, unsigned int reg) 719bool adau17x1_readable_register(struct device *dev, unsigned int reg)
710{ 720{
721 /* SigmaDSP parameter memory */
722 if (reg < 0x400)
723 return true;
724
711 switch (reg) { 725 switch (reg) {
712 case ADAU17X1_CLOCK_CONTROL: 726 case ADAU17X1_CLOCK_CONTROL:
713 case ADAU17X1_PLL_CONTROL: 727 case ADAU17X1_PLL_CONTROL:
diff --git a/sound/soc/codecs/adau17x1.h b/sound/soc/codecs/adau17x1.h
index 6861aa3aec02..e13583e6ff56 100644
--- a/sound/soc/codecs/adau17x1.h
+++ b/sound/soc/codecs/adau17x1.h
@@ -56,6 +56,7 @@ int adau17x1_set_micbias_voltage(struct snd_soc_codec *codec,
56 enum adau17x1_micbias_voltage micbias); 56 enum adau17x1_micbias_voltage micbias);
57bool adau17x1_readable_register(struct device *dev, unsigned int reg); 57bool adau17x1_readable_register(struct device *dev, unsigned int reg);
58bool adau17x1_volatile_register(struct device *dev, unsigned int reg); 58bool adau17x1_volatile_register(struct device *dev, unsigned int reg);
59bool adau17x1_precious_register(struct device *dev, unsigned int reg);
59int adau17x1_resume(struct snd_soc_codec *codec); 60int adau17x1_resume(struct snd_soc_codec *codec);
60 61
61extern const struct snd_soc_dai_ops adau17x1_dai_ops; 62extern const struct snd_soc_dai_ops adau17x1_dai_ops;