summaryrefslogtreecommitdiff
path: root/sound/soc/omap
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-12 23:03:58 +0000
committerMark Brown <broonie@linaro.org>2014-03-12 23:03:58 +0000
commit53a2c4db8cf229047de88b3f1bd41d5a5d2756eb (patch)
tree46ab33e4c837e0b893ddf8fb3817dd3f6042eb32 /sound/soc/omap
parentda8ab21cfea80655a0f7bbbc3f2fa0975970b8cb (diff)
parentf9fa2b1855a9ece2ec2a4f54b7f9131cd89257d6 (diff)
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/ams-delta.c45
-rw-r--r--sound/soc/omap/n810.c22
-rw-r--r--sound/soc/omap/rx51.c22
3 files changed, 52 insertions, 37 deletions
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 629446482a91..5750de197d0d 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -106,57 +106,59 @@ static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol,
if (ucontrol->value.enumerated.item[0] >= control->max)
return -EINVAL;
- mutex_lock(&codec->mutex);
+ snd_soc_dapm_mutex_lock(dapm);
/* Translate selection to bitmap */
pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]];
/* Setup pins after corresponding bits if changed */
pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE));
+
if (pin != snd_soc_dapm_get_pin_status(dapm, "Mouthpiece")) {
changed = 1;
if (pin)
- snd_soc_dapm_enable_pin(dapm, "Mouthpiece");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Mouthpiece");
else
- snd_soc_dapm_disable_pin(dapm, "Mouthpiece");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Mouthpiece");
}
pin = !!(pins & (1 << AMS_DELTA_EARPIECE));
if (pin != snd_soc_dapm_get_pin_status(dapm, "Earpiece")) {
changed = 1;
if (pin)
- snd_soc_dapm_enable_pin(dapm, "Earpiece");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Earpiece");
else
- snd_soc_dapm_disable_pin(dapm, "Earpiece");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Earpiece");
}
pin = !!(pins & (1 << AMS_DELTA_MICROPHONE));
if (pin != snd_soc_dapm_get_pin_status(dapm, "Microphone")) {
changed = 1;
if (pin)
- snd_soc_dapm_enable_pin(dapm, "Microphone");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Microphone");
else
- snd_soc_dapm_disable_pin(dapm, "Microphone");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Microphone");
}
pin = !!(pins & (1 << AMS_DELTA_SPEAKER));
if (pin != snd_soc_dapm_get_pin_status(dapm, "Speaker")) {
changed = 1;
if (pin)
- snd_soc_dapm_enable_pin(dapm, "Speaker");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Speaker");
else
- snd_soc_dapm_disable_pin(dapm, "Speaker");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker");
}
pin = !!(pins & (1 << AMS_DELTA_AGC));
if (pin != ams_delta_audio_agc) {
ams_delta_audio_agc = pin;
changed = 1;
if (pin)
- snd_soc_dapm_enable_pin(dapm, "AGCIN");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "AGCIN");
else
- snd_soc_dapm_disable_pin(dapm, "AGCIN");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "AGCIN");
}
+
if (changed)
- snd_soc_dapm_sync(dapm);
+ snd_soc_dapm_sync_unlocked(dapm);
- mutex_unlock(&codec->mutex);
+ snd_soc_dapm_mutex_unlock(dapm);
return changed;
}
@@ -315,12 +317,17 @@ static void cx81801_close(struct tty_struct *tty)
v253_ops.close(tty);
/* Revert back to default audio input/output constellation */
- snd_soc_dapm_disable_pin(dapm, "Mouthpiece");
- snd_soc_dapm_enable_pin(dapm, "Earpiece");
- snd_soc_dapm_enable_pin(dapm, "Microphone");
- snd_soc_dapm_disable_pin(dapm, "Speaker");
- snd_soc_dapm_disable_pin(dapm, "AGCIN");
- snd_soc_dapm_sync(dapm);
+ snd_soc_dapm_mutex_lock(dapm);
+
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Mouthpiece");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Earpiece");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Microphone");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "AGCIN");
+
+ snd_soc_dapm_sync_unlocked(dapm);
+
+ snd_soc_dapm_mutex_unlock(codec);
}
/* Line discipline .hangup() */
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index d163e18d85d4..fd4d9c809e50 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -68,26 +68,30 @@ static void n810_ext_control(struct snd_soc_dapm_context *dapm)
break;
}
+ snd_soc_dapm_mutex_lock(dapm);
+
if (n810_spk_func)
- snd_soc_dapm_enable_pin(dapm, "Ext Spk");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Ext Spk");
else
- snd_soc_dapm_disable_pin(dapm, "Ext Spk");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Ext Spk");
if (hp)
- snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
else
- snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
if (line1l)
- snd_soc_dapm_enable_pin(dapm, "LINE1L");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "LINE1L");
else
- snd_soc_dapm_disable_pin(dapm, "LINE1L");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "LINE1L");
if (n810_dmic_func)
- snd_soc_dapm_enable_pin(dapm, "DMic");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "DMic");
else
- snd_soc_dapm_disable_pin(dapm, "DMic");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "DMic");
+
+ snd_soc_dapm_sync_unlocked(dapm);
- snd_soc_dapm_sync(dapm);
+ snd_soc_dapm_mutex_unlock(dapm);
}
static int n810_startup(struct snd_pcm_substream *substream)
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 611179c3bca4..7fb3d4b10370 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -74,26 +74,30 @@ static void rx51_ext_control(struct snd_soc_dapm_context *dapm)
break;
}
+ snd_soc_dapm_mutex_lock(dapm);
+
if (rx51_spk_func)
- snd_soc_dapm_enable_pin(dapm, "Ext Spk");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Ext Spk");
else
- snd_soc_dapm_disable_pin(dapm, "Ext Spk");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Ext Spk");
if (rx51_dmic_func)
- snd_soc_dapm_enable_pin(dapm, "DMic");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "DMic");
else
- snd_soc_dapm_disable_pin(dapm, "DMic");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "DMic");
if (hp)
- snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
else
- snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
if (hs)
- snd_soc_dapm_enable_pin(dapm, "HS Mic");
+ snd_soc_dapm_enable_pin_unlocked(dapm, "HS Mic");
else
- snd_soc_dapm_disable_pin(dapm, "HS Mic");
+ snd_soc_dapm_disable_pin_unlocked(dapm, "HS Mic");
gpio_set_value(RX51_TVOUT_SEL_GPIO, tvout);
- snd_soc_dapm_sync(dapm);
+ snd_soc_dapm_sync_unlocked(dapm);
+
+ snd_soc_dapm_mutex_unlock(dapm);
}
static int rx51_startup(struct snd_pcm_substream *substream)