Skip to content

Commit

Permalink
ASoC: Lock the CODEC in PXA external jack controls
Browse files Browse the repository at this point in the history
When doing anything with the system, especially DAPM, we need to hold the
CODEC mutex.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Mark Brown committed Nov 6, 2010
1 parent 6424dca commit 71a2956
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,13 @@ static int corgi_startup(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_codec *codec = rtd->codec;

mutex_lock(&codec->mutex);

/* check the jack status at stream startup */
corgi_ext_control(codec);

mutex_unlock(&codec->mutex);

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions sound/soc/pxa/magician.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ static int magician_startup(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_codec *codec = rtd->codec;

mutex_lock(&codec->mutex);

/* check the jack status at stream startup */
magician_ext_control(codec);

mutex_unlock(&codec->mutex);

return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions sound/soc/pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ static int poodle_startup(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_codec *codec = rtd->codec;

mutex_lock(&codec->mutex);

/* check the jack status at stream startup */
poodle_ext_control(codec);

mutex_unlock(&codec->mutex);

return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions sound/soc/pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ static int spitz_startup(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_codec *codec = rtd->codec;

mutex_lock(&codec->mutex);

/* check the jack status at stream startup */
spitz_ext_control(codec);

mutex_unlock(&codec->mutex);

return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions sound/soc/pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ static int tosa_startup(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_codec *codec = rtd->codec;

mutex_lock(&codec->mutex);

/* check the jack status at stream startup */
tosa_ext_control(codec);

mutex_unlock(&codec->mutex);

return 0;
}

Expand Down

0 comments on commit 71a2956

Please sign in to comment.