ASoC: Lock the CODEC in PXA external jack controls
Subsystems (3)
PATCH 1/1 ASoC: Lock the CODEC in PXA external jack controls
When doing anything with the system, especially DAPM, we need to hold the CODEC mutex.
Signed-off-by Mark Brown <[email protected]>
--- sound/soc/pxa/corgi.c | 5 +++++ sound/soc/pxa/magician.c | 4 ++++ sound/soc/pxa/poodle.c | 5 +++++ sound/soc/pxa/spitz.c | 5 +++++ sound/soc/pxa/tosa.c | 5 +++++ 5 files changed, 24 insertions(+), 0 deletions(-)
sound/soc/pxa/corgi.c +5 -0
@@ -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 ; }
sound/soc/pxa/magician.c +4 -0
@@ -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 ; }
sound/soc/pxa/poodle.c +5 -0
@@ -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 ; }
sound/soc/pxa/spitz.c +5 -0
@@ -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 ; }
sound/soc/pxa/tosa.c +5 -0
@@ -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 ; }
Signature · 1 line
1.7.1
Quoted 4 lines · Mark Brown
When doing anything with the system, especially DAPM, we need to hold the CODEC mutex.
Signed-off-by Mark Brown <[email protected]>
I'm fine for this atm, but obviously we need to rework the DAPM locking a little as we dont want developers to have to care about locking internals.
Acked-by Liam Girdwood <[email protected]>
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Quoted 3 lines · Liam Girdwood
I'm fine for this atm, but obviously we need to rework the DAPM locking a little as we dont want developers to have to care about locking internals.
It's not just DAPM, either - there's the CODEC register maps as well.