Skip to content

Commit

Permalink
ASoC: dapm: Only lock CODEC for I/O if not using regmap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Apr 1, 2012
1 parent 49575fb commit e06ab3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ 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);
}

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);
Expand Down

0 comments on commit e06ab3b

Please sign in to comment.