]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: dapm: Only lock CODEC for I/O if not using regmap
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 6 Mar 2012 23:58:22 +0000 (23:58 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 1 Apr 2012 10:28:23 +0000 (11:28 +0100)
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@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
sound/soc/soc-dapm.c

index 1e449f375d98ea82636dee7a246a3fe6af57b2b6..dd603fa380978ca907a8ca7983c943ed50810a61 100644 (file)
@@ -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)
                mutex_lock(&w->codec->mutex);
        else if (w->platform)
                mutex_lock(&w->platform->mutex);
@@ -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)
                mutex_unlock(&w->codec->mutex);
        else if (w->platform)
                mutex_unlock(&w->platform->mutex);