Skip to contentSkip to conversation

ASoC: dapm: Only lock CODEC for I/O if not using regmap

PATCH In review Mark Brown 2 participants 2 messages Mar 7, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: dapm: Only lock CODEC for I/O if not using regmap

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.

---
 sound/soc/soc-dapm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-dapm.c +2 -2
index 6f4ea12b..25a395e 100644
@@ -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);
Signature · 1 line
1.7.9.1