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>
@@ -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;
}
@@ -72,9 +72,13 @@ static int magician_startup(struct snd_pcm_substream *substream)
magician_ext_control(codec);
@@ -77,8 +77,13 @@ static int poodle_startup(struct snd_pcm_substream *substream)
poodle_ext_control(codec);
@@ -108,8 +108,13 @@ static int spitz_startup(struct snd_pcm_substream *substream)
spitz_ext_control(codec);
@@ -81,8 +81,13 @@ static int tosa_startup(struct snd_pcm_substream *substream)
tosa_ext_control(codec);