From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 2/6] ASoC: adau17x1: Mark DSP parameter memory as readable and precious
Date: Wed, 19 Nov 2014 18:29:03 +0100 [thread overview]
Message-ID: <1416418148-14803-2-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1416418148-14803-1-git-send-email-lars@metafoo.de>
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(+)
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;
--
1.8.0
next prev parent reply other threads:[~2014-11-19 17:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 17:29 [PATCH 1/6] ASoC: sigmadsp: Refuse to load firmware files with a non-supported version Lars-Peter Clausen
2014-11-19 17:29 ` Lars-Peter Clausen [this message]
2014-11-21 16:30 ` [PATCH 2/6] ASoC: adau17x1: Mark DSP parameter memory as readable and precious Lars-Peter Clausen
2014-11-21 16:38 ` Mark Brown
2014-11-19 17:29 ` [PATCH 3/6] ASoC: sigmadsp: Drop support support SIGMA_ACTION_DELAY Lars-Peter Clausen
2014-11-19 17:29 ` [PATCH 4/6] ASoC: sigmadsp: Restructure in preparation for fw v2 support Lars-Peter Clausen
2014-11-19 17:29 ` [PATCH 5/6] ASoC: sigmadsp: Add support for fw v2 Lars-Peter Clausen
2014-11-19 17:29 ` [PATCH 6/6] ASoC: adau1701: Implement sigmadsp safeload Lars-Peter Clausen
2014-11-20 9:56 ` [PATCH 1/6] ASoC: sigmadsp: Refuse to load firmware files with a non-supported version Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416418148-14803-2-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox