diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2014-02-18 10:22:26 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-20 05:23:00 -0500 |
commit | f71b0fbe52f816649ab39ff329b7e4091276208a (patch) | |
tree | 6e77e57f388875779ff2a810104b02632cd382a8 /sound/soc/pxa/magician.c | |
parent | 4d9e73488d4e97b6019d178e53f8ec0a94c4e926 (diff) |
ASoC: pxa: magician: Update locking around use of DAPM pin API
The pin updates in this driver look like they are intended to be done
atomically, update to do so.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/pxa/magician.c')
-rw-r--r-- | sound/soc/pxa/magician.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index aace19e0fe2c..31242be08823 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c | |||
@@ -45,27 +45,31 @@ static void magician_ext_control(struct snd_soc_codec *codec) | |||
45 | { | 45 | { |
46 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 46 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
47 | 47 | ||
48 | snd_soc_dapm_mutex_lock(dapm); | ||
49 | |||
48 | if (magician_spk_switch) | 50 | if (magician_spk_switch) |
49 | snd_soc_dapm_enable_pin(dapm, "Speaker"); | 51 | snd_soc_dapm_enable_pin_unlocked(dapm, "Speaker"); |
50 | else | 52 | else |
51 | snd_soc_dapm_disable_pin(dapm, "Speaker"); | 53 | snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker"); |
52 | if (magician_hp_switch) | 54 | if (magician_hp_switch) |
53 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); | 55 | snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack"); |
54 | else | 56 | else |
55 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); | 57 | snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack"); |
56 | 58 | ||
57 | switch (magician_in_sel) { | 59 | switch (magician_in_sel) { |
58 | case MAGICIAN_MIC: | 60 | case MAGICIAN_MIC: |
59 | snd_soc_dapm_disable_pin(dapm, "Headset Mic"); | 61 | snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Mic"); |
60 | snd_soc_dapm_enable_pin(dapm, "Call Mic"); | 62 | snd_soc_dapm_enable_pin_unlocked(dapm, "Call Mic"); |
61 | break; | 63 | break; |
62 | case MAGICIAN_MIC_EXT: | 64 | case MAGICIAN_MIC_EXT: |
63 | snd_soc_dapm_disable_pin(dapm, "Call Mic"); | 65 | snd_soc_dapm_disable_pin_unlocked(dapm, "Call Mic"); |
64 | snd_soc_dapm_enable_pin(dapm, "Headset Mic"); | 66 | snd_soc_dapm_enable_pin_unlocked(dapm, "Headset Mic"); |
65 | break; | 67 | break; |
66 | } | 68 | } |
67 | 69 | ||
68 | snd_soc_dapm_sync(dapm); | 70 | snd_soc_dapm_sync_unlocked(dapm); |
71 | |||
72 | snd_soc_dapm_mutex_unlock(dapm); | ||
69 | } | 73 | } |
70 | 74 | ||
71 | static int magician_startup(struct snd_pcm_substream *substream) | 75 | static int magician_startup(struct snd_pcm_substream *substream) |