[alsa-devel] [PATCH] ASoC: dapm: Only lock CODEC for I/O if not using regmap

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Mar 7 01:03:15 CET 2012

If we do use regmap then regmap will take care of things for us. We
actually already have this check at a higher level for the current
users but this makes sure we do the right thing in the future too if
we need to.

Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
 sound/soc/soc-dapm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 6f4ea12b..25a395e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -208,7 +208,7 @@ static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val)
 static inline void soc_widget_lock(struct snd_soc_dapm_widget *w)
-	if (w->codec)
+	if (w->codec && !w->codec->using_regmap)
 	else if (w->platform)
@@ -216,7 +216,7 @@ static inline void soc_widget_lock(struct snd_soc_dapm_widget *w)
 static inline void soc_widget_unlock(struct snd_soc_dapm_widget *w)
-	if (w->codec)
+	if (w->codec && !w->codec->using_regmap)
 	else if (w->platform)

More information about the Alsa-devel mailing list