aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/Kconfig4
-rw-r--r--sound/soc/omap/ams-delta.c47
-rw-r--r--sound/soc/omap/n810.c26
-rw-r--r--sound/soc/omap/rx51.c22
4 files changed, 58 insertions, 41 deletions
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 22ad9c5654b5..e00659351a4e 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -58,7 +58,7 @@ config SND_OMAP_SOC_OSK5912
58 tristate "SoC Audio support for omap osk5912" 58 tristate "SoC Audio support for omap osk5912"
59 depends on SND_OMAP_SOC && MACH_OMAP_OSK && I2C 59 depends on SND_OMAP_SOC && MACH_OMAP_OSK && I2C
60 select SND_OMAP_SOC_MCBSP 60 select SND_OMAP_SOC_MCBSP
61 select SND_SOC_TLV320AIC23 61 select SND_SOC_TLV320AIC23_I2C
62 help 62 help
63 Say Y if you want to add support for SoC audio on osk5912. 63 Say Y if you want to add support for SoC audio on osk5912.
64 64
@@ -66,7 +66,7 @@ config SND_OMAP_SOC_AM3517EVM
66 tristate "SoC Audio support for OMAP3517 / AM3517 EVM" 66 tristate "SoC Audio support for OMAP3517 / AM3517 EVM"
67 depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C 67 depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C
68 select SND_OMAP_SOC_MCBSP 68 select SND_OMAP_SOC_MCBSP
69 select SND_SOC_TLV320AIC23 69 select SND_SOC_TLV320AIC23_I2C
70 help 70 help
71 Say Y if you want to add support for SoC audio on the OMAP3517 / AM3517 71 Say Y if you want to add support for SoC audio on the OMAP3517 / AM3517
72 EVM. 72 EVM.
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 99b314d53790..f141435b0b4a 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -103,60 +103,62 @@ static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol,
103 if (!codec->hw_write) 103 if (!codec->hw_write)
104 return -EUNATCH; 104 return -EUNATCH;
105 105
106 if (ucontrol->value.enumerated.item[0] >= control->max) 106 if (ucontrol->value.enumerated.item[0] >= control->items)
107 return -EINVAL; 107 return -EINVAL;
108 108
109 mutex_lock(&codec->mutex); 109 snd_soc_dapm_mutex_lock(dapm);
110 110
111 /* Translate selection to bitmap */ 111 /* Translate selection to bitmap */
112 pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]]; 112 pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]];
113 113
114 /* Setup pins after corresponding bits if changed */ 114 /* Setup pins after corresponding bits if changed */
115 pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE)); 115 pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE));
116
116 if (pin != snd_soc_dapm_get_pin_status(dapm, "Mouthpiece")) { 117 if (pin != snd_soc_dapm_get_pin_status(dapm, "Mouthpiece")) {
117 changed = 1; 118 changed = 1;
118 if (pin) 119 if (pin)
119 snd_soc_dapm_enable_pin(dapm, "Mouthpiece"); 120 snd_soc_dapm_enable_pin_unlocked(dapm, "Mouthpiece");
120 else 121 else
121 snd_soc_dapm_disable_pin(dapm, "Mouthpiece"); 122 snd_soc_dapm_disable_pin_unlocked(dapm, "Mouthpiece");
122 } 123 }
123 pin = !!(pins & (1 << AMS_DELTA_EARPIECE)); 124 pin = !!(pins & (1 << AMS_DELTA_EARPIECE));
124 if (pin != snd_soc_dapm_get_pin_status(dapm, "Earpiece")) { 125 if (pin != snd_soc_dapm_get_pin_status(dapm, "Earpiece")) {
125 changed = 1; 126 changed = 1;
126 if (pin) 127 if (pin)
127 snd_soc_dapm_enable_pin(dapm, "Earpiece"); 128 snd_soc_dapm_enable_pin_unlocked(dapm, "Earpiece");
128 else 129 else
129 snd_soc_dapm_disable_pin(dapm, "Earpiece"); 130 snd_soc_dapm_disable_pin_unlocked(dapm, "Earpiece");
130 } 131 }
131 pin = !!(pins & (1 << AMS_DELTA_MICROPHONE)); 132 pin = !!(pins & (1 << AMS_DELTA_MICROPHONE));
132 if (pin != snd_soc_dapm_get_pin_status(dapm, "Microphone")) { 133 if (pin != snd_soc_dapm_get_pin_status(dapm, "Microphone")) {
133 changed = 1; 134 changed = 1;
134 if (pin) 135 if (pin)
135 snd_soc_dapm_enable_pin(dapm, "Microphone"); 136 snd_soc_dapm_enable_pin_unlocked(dapm, "Microphone");
136 else 137 else
137 snd_soc_dapm_disable_pin(dapm, "Microphone"); 138 snd_soc_dapm_disable_pin_unlocked(dapm, "Microphone");
138 } 139 }
139 pin = !!(pins & (1 << AMS_DELTA_SPEAKER)); 140 pin = !!(pins & (1 << AMS_DELTA_SPEAKER));
140 if (pin != snd_soc_dapm_get_pin_status(dapm, "Speaker")) { 141 if (pin != snd_soc_dapm_get_pin_status(dapm, "Speaker")) {
141 changed = 1; 142 changed = 1;
142 if (pin) 143 if (pin)
143 snd_soc_dapm_enable_pin(dapm, "Speaker"); 144 snd_soc_dapm_enable_pin_unlocked(dapm, "Speaker");
144 else 145 else
145 snd_soc_dapm_disable_pin(dapm, "Speaker"); 146 snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker");
146 } 147 }
147 pin = !!(pins & (1 << AMS_DELTA_AGC)); 148 pin = !!(pins & (1 << AMS_DELTA_AGC));
148 if (pin != ams_delta_audio_agc) { 149 if (pin != ams_delta_audio_agc) {
149 ams_delta_audio_agc = pin; 150 ams_delta_audio_agc = pin;
150 changed = 1; 151 changed = 1;
151 if (pin) 152 if (pin)
152 snd_soc_dapm_enable_pin(dapm, "AGCIN"); 153 snd_soc_dapm_enable_pin_unlocked(dapm, "AGCIN");
153 else 154 else
154 snd_soc_dapm_disable_pin(dapm, "AGCIN"); 155 snd_soc_dapm_disable_pin_unlocked(dapm, "AGCIN");
155 } 156 }
157
156 if (changed) 158 if (changed)
157 snd_soc_dapm_sync(dapm); 159 snd_soc_dapm_sync_unlocked(dapm);
158 160
159 mutex_unlock(&codec->mutex); 161 snd_soc_dapm_mutex_unlock(dapm);
160 162
161 return changed; 163 return changed;
162} 164}
@@ -313,12 +315,17 @@ static void cx81801_close(struct tty_struct *tty)
313 v253_ops.close(tty); 315 v253_ops.close(tty);
314 316
315 /* Revert back to default audio input/output constellation */ 317 /* Revert back to default audio input/output constellation */
316 snd_soc_dapm_disable_pin(dapm, "Mouthpiece"); 318 snd_soc_dapm_mutex_lock(dapm);
317 snd_soc_dapm_enable_pin(dapm, "Earpiece"); 319
318 snd_soc_dapm_enable_pin(dapm, "Microphone"); 320 snd_soc_dapm_disable_pin_unlocked(dapm, "Mouthpiece");
319 snd_soc_dapm_disable_pin(dapm, "Speaker"); 321 snd_soc_dapm_enable_pin_unlocked(dapm, "Earpiece");
320 snd_soc_dapm_disable_pin(dapm, "AGCIN"); 322 snd_soc_dapm_enable_pin_unlocked(dapm, "Microphone");
321 snd_soc_dapm_sync(dapm); 323 snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker");
324 snd_soc_dapm_disable_pin_unlocked(dapm, "AGCIN");
325
326 snd_soc_dapm_sync_unlocked(dapm);
327
328 snd_soc_dapm_mutex_unlock(codec);
322} 329}
323 330
324/* Line discipline .hangup() */ 331/* Line discipline .hangup() */
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 3fde9e402710..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)
68 break; 68 break;
69 } 69 }
70 70
71 snd_soc_dapm_mutex_lock(dapm);
72
71 if (n810_spk_func) 73 if (n810_spk_func)
72 snd_soc_dapm_enable_pin(dapm, "Ext Spk"); 74 snd_soc_dapm_enable_pin_unlocked(dapm, "Ext Spk");
73 else 75 else
74 snd_soc_dapm_disable_pin(dapm, "Ext Spk"); 76 snd_soc_dapm_disable_pin_unlocked(dapm, "Ext Spk");
75 77
76 if (hp) 78 if (hp)
77 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 79 snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
78 else 80 else
79 snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); 81 snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
80 if (line1l) 82 if (line1l)
81 snd_soc_dapm_enable_pin(dapm, "LINE1L"); 83 snd_soc_dapm_enable_pin_unlocked(dapm, "LINE1L");
82 else 84 else
83 snd_soc_dapm_disable_pin(dapm, "LINE1L"); 85 snd_soc_dapm_disable_pin_unlocked(dapm, "LINE1L");
84 86
85 if (n810_dmic_func) 87 if (n810_dmic_func)
86 snd_soc_dapm_enable_pin(dapm, "DMic"); 88 snd_soc_dapm_enable_pin_unlocked(dapm, "DMic");
87 else 89 else
88 snd_soc_dapm_disable_pin(dapm, "DMic"); 90 snd_soc_dapm_disable_pin_unlocked(dapm, "DMic");
91
92 snd_soc_dapm_sync_unlocked(dapm);
89 93
90 snd_soc_dapm_sync(dapm); 94 snd_soc_dapm_mutex_unlock(dapm);
91} 95}
92 96
93static int n810_startup(struct snd_pcm_substream *substream) 97static int n810_startup(struct snd_pcm_substream *substream)
@@ -305,7 +309,9 @@ static int __init n810_soc_init(void)
305 int err; 309 int err;
306 struct device *dev; 310 struct device *dev;
307 311
308 if (!(machine_is_nokia_n810() || machine_is_nokia_n810_wimax())) 312 if (!of_have_populated_dt() ||
313 (!of_machine_is_compatible("nokia,n810") &&
314 !of_machine_is_compatible("nokia,n810-wimax")))
309 return -ENODEV; 315 return -ENODEV;
310 316
311 n810_snd_device = platform_device_alloc("soc-audio", -1); 317 n810_snd_device = platform_device_alloc("soc-audio", -1);
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)
74 break; 74 break;
75 } 75 }
76 76
77 snd_soc_dapm_mutex_lock(dapm);
78
77 if (rx51_spk_func) 79 if (rx51_spk_func)
78 snd_soc_dapm_enable_pin(dapm, "Ext Spk"); 80 snd_soc_dapm_enable_pin_unlocked(dapm, "Ext Spk");
79 else 81 else
80 snd_soc_dapm_disable_pin(dapm, "Ext Spk"); 82 snd_soc_dapm_disable_pin_unlocked(dapm, "Ext Spk");
81 if (rx51_dmic_func) 83 if (rx51_dmic_func)
82 snd_soc_dapm_enable_pin(dapm, "DMic"); 84 snd_soc_dapm_enable_pin_unlocked(dapm, "DMic");
83 else 85 else
84 snd_soc_dapm_disable_pin(dapm, "DMic"); 86 snd_soc_dapm_disable_pin_unlocked(dapm, "DMic");
85 if (hp) 87 if (hp)
86 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 88 snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
87 else 89 else
88 snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); 90 snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
89 if (hs) 91 if (hs)
90 snd_soc_dapm_enable_pin(dapm, "HS Mic"); 92 snd_soc_dapm_enable_pin_unlocked(dapm, "HS Mic");
91 else 93 else
92 snd_soc_dapm_disable_pin(dapm, "HS Mic"); 94 snd_soc_dapm_disable_pin_unlocked(dapm, "HS Mic");
93 95
94 gpio_set_value(RX51_TVOUT_SEL_GPIO, tvout); 96 gpio_set_value(RX51_TVOUT_SEL_GPIO, tvout);
95 97
96 snd_soc_dapm_sync(dapm); 98 snd_soc_dapm_sync_unlocked(dapm);
99
100 snd_soc_dapm_mutex_unlock(dapm);
97} 101}
98 102
99static int rx51_startup(struct snd_pcm_substream *substream) 103static int rx51_startup(struct snd_pcm_substream *substream)