ASoC: adau17x1: Mark DSP parameter memory as readable and precious
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 21 Nov 2014 17:53:51 +0000 (18:53 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 21 Nov 2014 18:17:50 +0000 (18:17 +0000)
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>
sound/soc/codecs/adau1761.c
sound/soc/codecs/adau1781.c
sound/soc/codecs/adau17x1.c
sound/soc/codecs/adau17x1.h

index 0ae1501f3c11ba4611b47617e5448a3a28f6beb4..4c018c575b01c024506bf456ab0ff12850e84e8d 100644 (file)
@@ -793,6 +793,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);
index 4c8ddc3c69e1d7371f342a4c4acd0b25cf584765..926fc99c1dda59682d667f58b82d13c01d1bd3e9 100644 (file)
@@ -472,6 +472,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);
index 1cab34c574138dc531335dd5a2d3765507d11978..50000477dc2a0913d114ab7028843b8600614a0d 100644 (file)
@@ -706,8 +706,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:
index 6861aa3aec02a8ab05dd047c74ffc4d5bee646ce..e13583e6ff56aa5d69a163ca7a447acdaa18cbd6 100644 (file)
@@ -56,6 +56,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;
This page took 0.03431 seconds and 5 git commands to generate.