aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-10-27 04:43:40 -0400
committerTakashi Iwai <tiwai@suse.de>2011-10-27 04:43:40 -0400
commitbb14eb0da72afb69be261b28ec858cbd5a35e089 (patch)
treefa72a87d21e506c990b63657d782936311cfa7cf /sound/soc/samsung
parent9430148d800dd929ad73da4c6afb67f793f8af43 (diff)
parent5927f94700e860ae27ff24e7f3bc9e4f7b9922eb (diff)
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/Kconfig6
-rw-r--r--sound/soc/samsung/ac97.c2
-rw-r--r--sound/soc/samsung/goni_wm8994.c15
-rw-r--r--sound/soc/samsung/h1940_uda1380.c19
-rw-r--r--sound/soc/samsung/i2s.c2
-rw-r--r--sound/soc/samsung/jive_wm8750.c17
-rw-r--r--sound/soc/samsung/neo1973_wm8753.c4
-rw-r--r--sound/soc/samsung/pcm.c2
-rw-r--r--sound/soc/samsung/rx1950_uda1380.c33
-rw-r--r--sound/soc/samsung/s3c-i2s-v2.c1
-rw-r--r--sound/soc/samsung/s3c2412-i2s.c2
-rw-r--r--sound/soc/samsung/s3c24xx-i2s.c2
-rw-r--r--sound/soc/samsung/s3c24xx_simtec.c2
-rw-r--r--sound/soc/samsung/s3c24xx_simtec_hermes.c11
-rw-r--r--sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c11
-rw-r--r--sound/soc/samsung/smartq_wm8987.c25
-rw-r--r--sound/soc/samsung/smdk_wm8580.c45
-rw-r--r--sound/soc/samsung/smdk_wm8994.c2
-rw-r--r--sound/soc/samsung/spdif.c4
-rw-r--r--sound/soc/samsung/speyside_wm8962.c41
20 files changed, 83 insertions, 163 deletions
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index dd3b3eac0805..53aaa69eda03 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -64,6 +64,8 @@ config SND_SOC_SAMSUNG_SMDK_WM8580
64config SND_SOC_SAMSUNG_SMDK_WM8994 64config SND_SOC_SAMSUNG_SMDK_WM8994
65 tristate "SoC I2S Audio support for WM8994 on SMDK" 65 tristate "SoC I2S Audio support for WM8994 on SMDK"
66 depends on SND_SOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210 || MACH_SMDK4212) 66 depends on SND_SOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210 || MACH_SMDK4212)
67 depends on I2C=y && GENERIC_HARDIRQS
68 select MFD_WM8994
67 select SND_SOC_WM8994 69 select SND_SOC_WM8994
68 select SND_SAMSUNG_I2S 70 select SND_SAMSUNG_I2S
69 help 71 help
@@ -150,7 +152,9 @@ config SND_SOC_SMARTQ
150config SND_SOC_GONI_AQUILA_WM8994 152config SND_SOC_GONI_AQUILA_WM8994
151 tristate "SoC I2S Audio support for AQUILA/GONI - WM8994" 153 tristate "SoC I2S Audio support for AQUILA/GONI - WM8994"
152 depends on SND_SOC_SAMSUNG && (MACH_GONI || MACH_AQUILA) 154 depends on SND_SOC_SAMSUNG && (MACH_GONI || MACH_AQUILA)
155 depends on I2C=y && GENERIC_HARDIRQS
153 select SND_SAMSUNG_I2S 156 select SND_SAMSUNG_I2S
157 select MFD_WM8994
154 select SND_SOC_WM8994 158 select SND_SOC_WM8994
155 help 159 help
156 Say Y if you want to add support for SoC audio on goni or aquila 160 Say Y if you want to add support for SoC audio on goni or aquila
@@ -174,6 +178,8 @@ config SND_SOC_SMDK_WM8580_PCM
174config SND_SOC_SMDK_WM8994_PCM 178config SND_SOC_SMDK_WM8994_PCM
175 tristate "SoC PCM Audio support for WM8994 on SMDK" 179 tristate "SoC PCM Audio support for WM8994 on SMDK"
176 depends on SND_SOC_SAMSUNG && (MACH_SMDKC210 || MACH_SMDKV310 || MACH_SMDK4212) 180 depends on SND_SOC_SAMSUNG && (MACH_SMDKC210 || MACH_SMDKV310 || MACH_SMDK4212)
181 depends on I2C=y && GENERIC_HARDIRQS
182 select MFD_WM8994
177 select SND_SOC_WM8994 183 select SND_SOC_WM8994
178 select SND_SAMSUNG_PCM 184 select SND_SAMSUNG_PCM
179 help 185 help
diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index 884c8a107bf9..b5e922f469d5 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -495,7 +495,7 @@ static __devexit int s3c_ac97_remove(struct platform_device *pdev)
495 495
496static struct platform_driver s3c_ac97_driver = { 496static struct platform_driver s3c_ac97_driver = {
497 .probe = s3c_ac97_probe, 497 .probe = s3c_ac97_probe,
498 .remove = s3c_ac97_remove, 498 .remove = __devexit_p(s3c_ac97_remove),
499 .driver = { 499 .driver = {
500 .name = "samsung-ac97", 500 .name = "samsung-ac97",
501 .owner = THIS_MODULE, 501 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/goni_wm8994.c b/sound/soc/samsung/goni_wm8994.c
index eb6d72ed55a7..4a34f608e131 100644
--- a/sound/soc/samsung/goni_wm8994.c
+++ b/sound/soc/samsung/goni_wm8994.c
@@ -99,14 +99,6 @@ static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd)
99 struct snd_soc_dapm_context *dapm = &codec->dapm; 99 struct snd_soc_dapm_context *dapm = &codec->dapm;
100 int ret; 100 int ret;
101 101
102 /* add goni specific widgets */
103 snd_soc_dapm_new_controls(dapm, goni_dapm_widgets,
104 ARRAY_SIZE(goni_dapm_widgets));
105
106 /* set up goni specific audio routes */
107 snd_soc_dapm_add_routes(dapm, goni_dapm_routes,
108 ARRAY_SIZE(goni_dapm_routes));
109
110 /* set endpoints to not connected */ 102 /* set endpoints to not connected */
111 snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN"); 103 snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN");
112 snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP"); 104 snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP");
@@ -120,8 +112,6 @@ static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd)
120 snd_soc_dapm_nc_pin(dapm, "SPKOUTRP"); 112 snd_soc_dapm_nc_pin(dapm, "SPKOUTRP");
121 } 113 }
122 114
123 snd_soc_dapm_sync(dapm);
124
125 /* Headset jack detection */ 115 /* Headset jack detection */
126 ret = snd_soc_jack_new(codec, "Headset Jack", 116 ret = snd_soc_jack_new(codec, "Headset Jack",
127 SND_JACK_HEADSET | SND_JACK_MECHANICAL | SND_JACK_AVOUT, 117 SND_JACK_HEADSET | SND_JACK_MECHANICAL | SND_JACK_AVOUT,
@@ -255,6 +245,11 @@ static struct snd_soc_card goni = {
255 .name = "goni", 245 .name = "goni",
256 .dai_link = goni_dai, 246 .dai_link = goni_dai,
257 .num_links = ARRAY_SIZE(goni_dai), 247 .num_links = ARRAY_SIZE(goni_dai),
248
249 .dapm_widgets = goni_dapm_widgets,
250 .num_dapm_widgets = ARRAY_SIZE(goni_dapm_widgets),
251 .dapm_routes = goni_dapm_routes,
252 .num_dapm_routes = ARRAY_SIZE(goni_dapm_routes),
258}; 253};
259 254
260static int __init goni_init(void) 255static int __init goni_init(void)
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c
index c6c65892294e..f75a4b60cf38 100644
--- a/sound/soc/samsung/h1940_uda1380.c
+++ b/sound/soc/samsung/h1940_uda1380.c
@@ -182,24 +182,10 @@ static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd)
182 struct snd_soc_dapm_context *dapm = &codec->dapm; 182 struct snd_soc_dapm_context *dapm = &codec->dapm;
183 int err; 183 int err;
184 184
185 /* Add h1940 specific widgets */
186 err = snd_soc_dapm_new_controls(dapm, uda1380_dapm_widgets,
187 ARRAY_SIZE(uda1380_dapm_widgets));
188 if (err)
189 return err;
190
191 /* Set up h1940 specific audio path audio_mapnects */
192 err = snd_soc_dapm_add_routes(dapm, audio_map,
193 ARRAY_SIZE(audio_map));
194 if (err)
195 return err;
196
197 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 185 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
198 snd_soc_dapm_enable_pin(dapm, "Speaker"); 186 snd_soc_dapm_enable_pin(dapm, "Speaker");
199 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 187 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
200 188
201 snd_soc_dapm_sync(dapm);
202
203 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE, 189 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE,
204 &hp_jack); 190 &hp_jack);
205 191
@@ -230,6 +216,11 @@ static struct snd_soc_card h1940_asoc = {
230 .name = "h1940", 216 .name = "h1940",
231 .dai_link = h1940_uda1380_dai, 217 .dai_link = h1940_uda1380_dai,
232 .num_links = ARRAY_SIZE(h1940_uda1380_dai), 218 .num_links = ARRAY_SIZE(h1940_uda1380_dai),
219
220 .dapm_widgets = uda1380_dapm_widgets,
221 .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets),
222 .dapm_routes = audio_map,
223 .num_dapm_routes = ARRAY_SIZE(audio_map),
233}; 224};
234 225
235static int __init h1940_init(void) 226static int __init h1940_init(void)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index c086b78539ee..0c9ac20d2223 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1136,7 +1136,7 @@ static __devexit int samsung_i2s_remove(struct platform_device *pdev)
1136 1136
1137static struct platform_driver samsung_i2s_driver = { 1137static struct platform_driver samsung_i2s_driver = {
1138 .probe = samsung_i2s_probe, 1138 .probe = samsung_i2s_probe,
1139 .remove = samsung_i2s_remove, 1139 .remove = __devexit_p(samsung_i2s_remove),
1140 .driver = { 1140 .driver = {
1141 .name = "samsung-i2s", 1141 .name = "samsung-i2s",
1142 .owner = THIS_MODULE, 1142 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/jive_wm8750.c b/sound/soc/samsung/jive_wm8750.c
index ed8f13a29c85..f5f7c6f822d5 100644
--- a/sound/soc/samsung/jive_wm8750.c
+++ b/sound/soc/samsung/jive_wm8750.c
@@ -110,18 +110,6 @@ static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd)
110 snd_soc_dapm_nc_pin(dapm, "OUT3"); 110 snd_soc_dapm_nc_pin(dapm, "OUT3");
111 snd_soc_dapm_nc_pin(dapm, "MONO"); 111 snd_soc_dapm_nc_pin(dapm, "MONO");
112 112
113 /* Add jive specific widgets */
114 err = snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets,
115 ARRAY_SIZE(wm8750_dapm_widgets));
116 if (err) {
117 printk(KERN_ERR "%s: failed to add widgets (%d)\n",
118 __func__, err);
119 return err;
120 }
121
122 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
123 snd_soc_dapm_sync(dapm);
124
125 return 0; 113 return 0;
126} 114}
127 115
@@ -141,6 +129,11 @@ static struct snd_soc_card snd_soc_machine_jive = {
141 .name = "Jive", 129 .name = "Jive",
142 .dai_link = &jive_dai, 130 .dai_link = &jive_dai,
143 .num_links = 1, 131 .num_links = 1,
132
133 .dapm_widgtets = wm8750_dapm_widgets,
134 .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets),
135 .dapm_routes = audio_map,
136 .num_dapm_routes = ARRAY_SIZE(audio_map),
144}; 137};
145 138
146static struct platform_device *jive_snd_device; 139static struct platform_device *jive_snd_device;
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c
index 16152ed08648..7207189cd211 100644
--- a/sound/soc/samsung/neo1973_wm8753.c
+++ b/sound/soc/samsung/neo1973_wm8753.c
@@ -367,8 +367,6 @@ static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd)
367 return ret; 367 return ret;
368 } 368 }
369 369
370 snd_soc_dapm_sync(dapm);
371
372 return 0; 370 return 0;
373} 371}
374 372
@@ -409,8 +407,6 @@ static int neo1973_lm4857_init(struct snd_soc_dapm_context *dapm)
409 snd_soc_dapm_ignore_suspend(dapm, "Handset Spk"); 407 snd_soc_dapm_ignore_suspend(dapm, "Handset Spk");
410 snd_soc_dapm_ignore_suspend(dapm, "Headphone"); 408 snd_soc_dapm_ignore_suspend(dapm, "Headphone");
411 409
412 snd_soc_dapm_sync(dapm);
413
414 return 0; 410 return 0;
415} 411}
416 412
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 9c7e8b48aed6..e55d7a5c4bdc 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -624,7 +624,7 @@ static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev)
624 624
625static struct platform_driver s3c_pcm_driver = { 625static struct platform_driver s3c_pcm_driver = {
626 .probe = s3c_pcm_dev_probe, 626 .probe = s3c_pcm_dev_probe,
627 .remove = s3c_pcm_dev_remove, 627 .remove = __devexit_p(s3c_pcm_dev_remove),
628 .driver = { 628 .driver = {
629 .name = "samsung-pcm", 629 .name = "samsung-pcm",
630 .owner = THIS_MODULE, 630 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c
index bc8c1676459f..aea7f1b24e6b 100644
--- a/sound/soc/samsung/rx1950_uda1380.c
+++ b/sound/soc/samsung/rx1950_uda1380.c
@@ -90,12 +90,6 @@ static struct snd_soc_dai_link rx1950_uda1380_dai[] = {
90 }, 90 },
91}; 91};
92 92
93static struct snd_soc_card rx1950_asoc = {
94 .name = "rx1950",
95 .dai_link = rx1950_uda1380_dai,
96 .num_links = ARRAY_SIZE(rx1950_uda1380_dai),
97};
98
99/* rx1950 machine dapm widgets */ 93/* rx1950 machine dapm widgets */
100static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = { 94static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = {
101 SND_SOC_DAPM_HP("Headphone Jack", NULL), 95 SND_SOC_DAPM_HP("Headphone Jack", NULL),
@@ -117,6 +111,17 @@ static const struct snd_soc_dapm_route audio_map[] = {
117 {"VINM", NULL, "Mic Jack"}, 111 {"VINM", NULL, "Mic Jack"},
118}; 112};
119 113
114static struct snd_soc_card rx1950_asoc = {
115 .name = "rx1950",
116 .dai_link = rx1950_uda1380_dai,
117 .num_links = ARRAY_SIZE(rx1950_uda1380_dai),
118
119 .dapm_widgets = uda1380_dapm_widgets,
120 .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets),
121 .dapm_routes = audio_map,
122 .num_dapm_routes = ARRAY_SIZE(audio_map),
123};
124
120static struct platform_device *s3c24xx_snd_device; 125static struct platform_device *s3c24xx_snd_device;
121 126
122static int rx1950_startup(struct snd_pcm_substream *substream) 127static int rx1950_startup(struct snd_pcm_substream *substream)
@@ -220,26 +225,10 @@ static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd)
220 struct snd_soc_dapm_context *dapm = &codec->dapm; 225 struct snd_soc_dapm_context *dapm = &codec->dapm;
221 int err; 226 int err;
222 227
223 /* Add rx1950 specific widgets */
224 err = snd_soc_dapm_new_controls(dapm, uda1380_dapm_widgets,
225 ARRAY_SIZE(uda1380_dapm_widgets));
226
227 if (err)
228 return err;
229
230 /* Set up rx1950 specific audio path audio_mapnects */
231 err = snd_soc_dapm_add_routes(dapm, audio_map,
232 ARRAY_SIZE(audio_map));
233
234 if (err)
235 return err;
236
237 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 228 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
238 snd_soc_dapm_enable_pin(dapm, "Speaker"); 229 snd_soc_dapm_enable_pin(dapm, "Speaker");
239 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 230 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
240 231
241 snd_soc_dapm_sync(dapm);
242
243 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE, 232 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE,
244 &hp_jack); 233 &hp_jack);
245 234
diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c
index 52074a2b0696..7a73380b3560 100644
--- a/sound/soc/samsung/s3c-i2s-v2.c
+++ b/sound/soc/samsung/s3c-i2s-v2.c
@@ -16,6 +16,7 @@
16 * option) any later version. 16 * option) any later version.
17 */ 17 */
18 18
19#include <linux/module.h>
19#include <linux/delay.h> 20#include <linux/delay.h>
20#include <linux/clk.h> 21#include <linux/clk.h>
21#include <linux/io.h> 22#include <linux/io.h>
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c
index 7ab8e2c29216..f26a8bfb2357 100644
--- a/sound/soc/samsung/s3c2412-i2s.c
+++ b/sound/soc/samsung/s3c2412-i2s.c
@@ -176,7 +176,7 @@ static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev)
176 176
177static struct platform_driver s3c2412_iis_driver = { 177static struct platform_driver s3c2412_iis_driver = {
178 .probe = s3c2412_iis_dev_probe, 178 .probe = s3c2412_iis_dev_probe,
179 .remove = s3c2412_iis_dev_remove, 179 .remove = __devexit_p(s3c2412_iis_dev_remove),
180 .driver = { 180 .driver = {
181 .name = "s3c2412-iis", 181 .name = "s3c2412-iis",
182 .owner = THIS_MODULE, 182 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c
index 21c92e2e3007..c08117e658db 100644
--- a/sound/soc/samsung/s3c24xx-i2s.c
+++ b/sound/soc/samsung/s3c24xx-i2s.c
@@ -481,7 +481,7 @@ static __devexit int s3c24xx_iis_dev_remove(struct platform_device *pdev)
481 481
482static struct platform_driver s3c24xx_iis_driver = { 482static struct platform_driver s3c24xx_iis_driver = {
483 .probe = s3c24xx_iis_dev_probe, 483 .probe = s3c24xx_iis_dev_probe,
484 .remove = s3c24xx_iis_dev_remove, 484 .remove = __devexit_p(s3c24xx_iis_dev_remove),
485 .driver = { 485 .driver = {
486 .name = "s3c24xx-iis", 486 .name = "s3c24xx-iis",
487 .owner = THIS_MODULE, 487 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c
index 349566f0686b..c8d525bf6122 100644
--- a/sound/soc/samsung/s3c24xx_simtec.c
+++ b/sound/soc/samsung/s3c24xx_simtec.c
@@ -300,7 +300,7 @@ static void detach_gpio_amp(struct s3c24xx_audio_simtec_pdata *pd)
300} 300}
301 301
302#ifdef CONFIG_PM 302#ifdef CONFIG_PM
303int simtec_audio_resume(struct device *dev) 303static int simtec_audio_resume(struct device *dev)
304{ 304{
305 simtec_call_startup(pdata); 305 simtec_call_startup(pdata);
306 return 0; 306 return 0;
diff --git a/sound/soc/samsung/s3c24xx_simtec_hermes.c b/sound/soc/samsung/s3c24xx_simtec_hermes.c
index ce6aef604179..6bc5a36af1d9 100644
--- a/sound/soc/samsung/s3c24xx_simtec_hermes.c
+++ b/sound/soc/samsung/s3c24xx_simtec_hermes.c
@@ -65,18 +65,12 @@ static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd)
65 struct snd_soc_codec *codec = rtd->codec; 65 struct snd_soc_codec *codec = rtd->codec;
66 struct snd_soc_dapm_context *dapm = &codec->dapm; 66 struct snd_soc_dapm_context *dapm = &codec->dapm;
67 67
68 snd_soc_dapm_new_controls(dapm, dapm_widgets,
69 ARRAY_SIZE(dapm_widgets));
70
71 snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map));
72
73 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 68 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
74 snd_soc_dapm_enable_pin(dapm, "Line In"); 69 snd_soc_dapm_enable_pin(dapm, "Line In");
75 snd_soc_dapm_enable_pin(dapm, "Line Out"); 70 snd_soc_dapm_enable_pin(dapm, "Line Out");
76 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 71 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
77 72
78 simtec_audio_init(rtd); 73 simtec_audio_init(rtd);
79 snd_soc_dapm_sync(dapm);
80 74
81 return 0; 75 return 0;
82} 76}
@@ -96,6 +90,11 @@ static struct snd_soc_card snd_soc_machine_simtec_aic33 = {
96 .name = "Simtec-Hermes", 90 .name = "Simtec-Hermes",
97 .dai_link = &simtec_dai_aic33, 91 .dai_link = &simtec_dai_aic33,
98 .num_links = 1, 92 .num_links = 1,
93
94 .dapm_widgets = dapm_widgets,
95 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
96 .dapm_routes = base_map,
97 .num_dapm_routes = ARRAY_SIZE(base_map),
99}; 98};
100 99
101static int __devinit simtec_audio_hermes_probe(struct platform_device *pd) 100static int __devinit simtec_audio_hermes_probe(struct platform_device *pd)
diff --git a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
index a7ef7db54687..7bdda7674008 100644
--- a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
+++ b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
@@ -54,18 +54,12 @@ static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
54 struct snd_soc_codec *codec = rtd->codec; 54 struct snd_soc_codec *codec = rtd->codec;
55 struct snd_soc_dapm_context *dapm = &codec->dapm; 55 struct snd_soc_dapm_context *dapm = &codec->dapm;
56 56
57 snd_soc_dapm_new_controls(dapm, dapm_widgets,
58 ARRAY_SIZE(dapm_widgets));
59
60 snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map));
61
62 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 57 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
63 snd_soc_dapm_enable_pin(dapm, "Line In"); 58 snd_soc_dapm_enable_pin(dapm, "Line In");
64 snd_soc_dapm_enable_pin(dapm, "Line Out"); 59 snd_soc_dapm_enable_pin(dapm, "Line Out");
65 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 60 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
66 61
67 simtec_audio_init(rtd); 62 simtec_audio_init(rtd);
68 snd_soc_dapm_sync(dapm);
69 63
70 return 0; 64 return 0;
71} 65}
@@ -85,6 +79,11 @@ static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
85 .name = "Simtec", 79 .name = "Simtec",
86 .dai_link = &simtec_dai_aic23, 80 .dai_link = &simtec_dai_aic23,
87 .num_links = 1, 81 .num_links = 1,
82
83 .dapm_widgets = dapm_widgets,
84 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
85 .dapm_routes = base_map,
86 .num_dapm_routes = ARRAY_SIZE(base_map),
88}; 87};
89 88
90static int __devinit simtec_audio_tlv320aic23_probe(struct platform_device *pd) 89static int __devinit simtec_audio_tlv320aic23_probe(struct platform_device *pd)
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
index bbd14768ecd3..6ac6bc2bcc4e 100644
--- a/sound/soc/samsung/smartq_wm8987.c
+++ b/sound/soc/samsung/smartq_wm8987.c
@@ -153,20 +153,6 @@ static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
153 struct snd_soc_dapm_context *dapm = &codec->dapm; 153 struct snd_soc_dapm_context *dapm = &codec->dapm;
154 int err = 0; 154 int err = 0;
155 155
156 /* Add SmartQ specific widgets */
157 snd_soc_dapm_new_controls(dapm, wm8987_dapm_widgets,
158 ARRAY_SIZE(wm8987_dapm_widgets));
159
160 /* add SmartQ specific controls */
161 err = snd_soc_add_controls(codec, wm8987_smartq_controls,
162 ARRAY_SIZE(wm8987_smartq_controls));
163
164 if (err < 0)
165 return err;
166
167 /* setup SmartQ specific audio path */
168 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
169
170 /* set endpoints to not connected */ 156 /* set endpoints to not connected */
171 snd_soc_dapm_nc_pin(dapm, "LINPUT1"); 157 snd_soc_dapm_nc_pin(dapm, "LINPUT1");
172 snd_soc_dapm_nc_pin(dapm, "RINPUT1"); 158 snd_soc_dapm_nc_pin(dapm, "RINPUT1");
@@ -178,10 +164,6 @@ static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
178 snd_soc_dapm_enable_pin(dapm, "Internal Mic"); 164 snd_soc_dapm_enable_pin(dapm, "Internal Mic");
179 snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); 165 snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
180 166
181 err = snd_soc_dapm_sync(dapm);
182 if (err)
183 return err;
184
185 /* Headphone jack detection */ 167 /* Headphone jack detection */
186 err = snd_soc_jack_new(codec, "Headphone Jack", 168 err = snd_soc_jack_new(codec, "Headphone Jack",
187 SND_JACK_HEADPHONE, &smartq_jack); 169 SND_JACK_HEADPHONE, &smartq_jack);
@@ -217,6 +199,13 @@ static struct snd_soc_card snd_soc_smartq = {
217 .name = "SmartQ", 199 .name = "SmartQ",
218 .dai_link = smartq_dai, 200 .dai_link = smartq_dai,
219 .num_links = ARRAY_SIZE(smartq_dai), 201 .num_links = ARRAY_SIZE(smartq_dai),
202
203 .dapm_widgets = wm8987_dapm_widgets,
204 .num_dapm_widgets = ARRAY_SIZE(wm8987_dapm_widgets),
205 .dapm_routes = audio_map,
206 .num_dapm_routes = ARRAY_SIZE(audio_map),
207 .controls = wm8987_smartq_controls,
208 .num_controls = ARRAY_SIZE(wm8987_smartq_controls),
220}; 209};
221 210
222static struct platform_device *smartq_snd_device; 211static struct platform_device *smartq_snd_device;
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c
index 20deecf3b243..8f92ffceb5ca 100644
--- a/sound/soc/samsung/smdk_wm8580.c
+++ b/sound/soc/samsung/smdk_wm8580.c
@@ -119,30 +119,24 @@ static struct snd_soc_ops smdk_ops = {
119}; 119};
120 120
121/* SMDK Playback widgets */ 121/* SMDK Playback widgets */
122static const struct snd_soc_dapm_widget wm8580_dapm_widgets_pbk[] = { 122static const struct snd_soc_dapm_widget smdk_wm8580_dapm_widgets[] = {
123 SND_SOC_DAPM_HP("Front", NULL), 123 SND_SOC_DAPM_HP("Front", NULL),
124 SND_SOC_DAPM_HP("Center+Sub", NULL), 124 SND_SOC_DAPM_HP("Center+Sub", NULL),
125 SND_SOC_DAPM_HP("Rear", NULL), 125 SND_SOC_DAPM_HP("Rear", NULL),
126};
127 126
128/* SMDK Capture widgets */
129static const struct snd_soc_dapm_widget wm8580_dapm_widgets_cpt[] = {
130 SND_SOC_DAPM_MIC("MicIn", NULL), 127 SND_SOC_DAPM_MIC("MicIn", NULL),
131 SND_SOC_DAPM_LINE("LineIn", NULL), 128 SND_SOC_DAPM_LINE("LineIn", NULL),
132}; 129};
133 130
134/* SMDK-PAIFTX connections */ 131/* SMDK-PAIFTX connections */
135static const struct snd_soc_dapm_route audio_map_tx[] = { 132static const struct snd_soc_dapm_route smdk_wm8580_audio_map[] = {
136 /* MicIn feeds AINL */ 133 /* MicIn feeds AINL */
137 {"AINL", NULL, "MicIn"}, 134 {"AINL", NULL, "MicIn"},
138 135
139 /* LineIn feeds AINL/R */ 136 /* LineIn feeds AINL/R */
140 {"AINL", NULL, "LineIn"}, 137 {"AINL", NULL, "LineIn"},
141 {"AINR", NULL, "LineIn"}, 138 {"AINR", NULL, "LineIn"},
142};
143 139
144/* SMDK-PAIFRX connections */
145static const struct snd_soc_dapm_route audio_map_rx[] = {
146 /* Front Left/Right are fed VOUT1L/R */ 140 /* Front Left/Right are fed VOUT1L/R */
147 {"Front", NULL, "VOUT1L"}, 141 {"Front", NULL, "VOUT1L"},
148 {"Front", NULL, "VOUT1R"}, 142 {"Front", NULL, "VOUT1R"},
@@ -161,39 +155,11 @@ static int smdk_wm8580_init_paiftx(struct snd_soc_pcm_runtime *rtd)
161 struct snd_soc_codec *codec = rtd->codec; 155 struct snd_soc_codec *codec = rtd->codec;
162 struct snd_soc_dapm_context *dapm = &codec->dapm; 156 struct snd_soc_dapm_context *dapm = &codec->dapm;
163 157
164 /* Add smdk specific Capture widgets */
165 snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_cpt,
166 ARRAY_SIZE(wm8580_dapm_widgets_cpt));
167
168 /* Set up PAIFTX audio path */
169 snd_soc_dapm_add_routes(dapm, audio_map_tx, ARRAY_SIZE(audio_map_tx));
170
171 /* Enabling the microphone requires the fitting of a 0R 158 /* Enabling the microphone requires the fitting of a 0R
172 * resistor to connect the line from the microphone jack. 159 * resistor to connect the line from the microphone jack.
173 */ 160 */
174 snd_soc_dapm_disable_pin(dapm, "MicIn"); 161 snd_soc_dapm_disable_pin(dapm, "MicIn");
175 162
176 /* signal a DAPM event */
177 snd_soc_dapm_sync(dapm);
178
179 return 0;
180}
181
182static int smdk_wm8580_init_paifrx(struct snd_soc_pcm_runtime *rtd)
183{
184 struct snd_soc_codec *codec = rtd->codec;
185 struct snd_soc_dapm_context *dapm = &codec->dapm;
186
187 /* Add smdk specific Playback widgets */
188 snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets_pbk,
189 ARRAY_SIZE(wm8580_dapm_widgets_pbk));
190
191 /* Set up PAIFRX audio path */
192 snd_soc_dapm_add_routes(dapm, audio_map_rx, ARRAY_SIZE(audio_map_rx));
193
194 /* signal a DAPM event */
195 snd_soc_dapm_sync(dapm);
196
197 return 0; 163 return 0;
198} 164}
199 165
@@ -211,7 +177,6 @@ static struct snd_soc_dai_link smdk_dai[] = {
211 .codec_dai_name = "wm8580-hifi-playback", 177 .codec_dai_name = "wm8580-hifi-playback",
212 .platform_name = "samsung-audio", 178 .platform_name = "samsung-audio",
213 .codec_name = "wm8580.0-001b", 179 .codec_name = "wm8580.0-001b",
214 .init = smdk_wm8580_init_paifrx,
215 .ops = &smdk_ops, 180 .ops = &smdk_ops,
216 }, 181 },
217 [PRI_CAPTURE] = { /* Primary Capture i/f */ 182 [PRI_CAPTURE] = { /* Primary Capture i/f */
@@ -231,7 +196,6 @@ static struct snd_soc_dai_link smdk_dai[] = {
231 .codec_dai_name = "wm8580-hifi-playback", 196 .codec_dai_name = "wm8580-hifi-playback",
232 .platform_name = "samsung-audio", 197 .platform_name = "samsung-audio",
233 .codec_name = "wm8580.0-001b", 198 .codec_name = "wm8580.0-001b",
234 .init = smdk_wm8580_init_paifrx,
235 .ops = &smdk_ops, 199 .ops = &smdk_ops,
236 }, 200 },
237}; 201};
@@ -240,6 +204,11 @@ static struct snd_soc_card smdk = {
240 .name = "SMDK-I2S", 204 .name = "SMDK-I2S",
241 .dai_link = smdk_dai, 205 .dai_link = smdk_dai,
242 .num_links = 2, 206 .num_links = 2,
207
208 .dapm_widgets = smdk_wm8580_dapm_widgets,
209 .num_dapm_widgets = ARRAY_SIZE(smdk_wm8580_dapm_widgets),
210 .dapm_routes = smdk_wm8580_audio_map,
211 .num_dapm_routes = ARRAY_SIZE(smdk_wm8580_audio_map),
243}; 212};
244 213
245static struct platform_device *smdk_snd_device; 214static struct platform_device *smdk_snd_device;
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 45fbe2b3727f..f75e43997d5b 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -117,8 +117,6 @@ static int smdk_wm8994_init_paiftx(struct snd_soc_pcm_runtime *rtd)
117 snd_soc_dapm_nc_pin(dapm, "IN1RP"); 117 snd_soc_dapm_nc_pin(dapm, "IN1RP");
118 snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP"); 118 snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP");
119 119
120 snd_soc_dapm_sync(dapm);
121
122 return 0; 120 return 0;
123} 121}
124 122
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index 28c491dacf7a..3122f3154bfa 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -340,7 +340,7 @@ static struct snd_soc_dai_ops spdif_dai_ops = {
340 .shutdown = spdif_shutdown, 340 .shutdown = spdif_shutdown,
341}; 341};
342 342
343struct snd_soc_dai_driver samsung_spdif_dai = { 343static struct snd_soc_dai_driver samsung_spdif_dai = {
344 .name = "samsung-spdif", 344 .name = "samsung-spdif",
345 .playback = { 345 .playback = {
346 .stream_name = "S/PDIF Playback", 346 .stream_name = "S/PDIF Playback",
@@ -475,7 +475,7 @@ static __devexit int spdif_remove(struct platform_device *pdev)
475 475
476static struct platform_driver samsung_spdif_driver = { 476static struct platform_driver samsung_spdif_driver = {
477 .probe = spdif_probe, 477 .probe = spdif_probe,
478 .remove = spdif_remove, 478 .remove = __devexit_p(spdif_remove),
479 .driver = { 479 .driver = {
480 .name = "samsung-spdif", 480 .name = "samsung-spdif",
481 .owner = THIS_MODULE, 481 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/speyside_wm8962.c b/sound/soc/samsung/speyside_wm8962.c
index 3820a6b057dc..8a082044436e 100644
--- a/sound/soc/samsung/speyside_wm8962.c
+++ b/sound/soc/samsung/speyside_wm8962.c
@@ -16,6 +16,8 @@
16 16
17#include "../codecs/wm8962.h" 17#include "../codecs/wm8962.h"
18 18
19static int sample_rate = 44100;
20
19static int speyside_wm8962_set_bias_level(struct snd_soc_card *card, 21static int speyside_wm8962_set_bias_level(struct snd_soc_card *card,
20 struct snd_soc_dapm_context *dapm, 22 struct snd_soc_dapm_context *dapm,
21 enum snd_soc_bias_level level) 23 enum snd_soc_bias_level level)
@@ -31,13 +33,13 @@ static int speyside_wm8962_set_bias_level(struct snd_soc_card *card,
31 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 33 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) {
32 ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL, 34 ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL,
33 WM8962_FLL_MCLK, 32768, 35 WM8962_FLL_MCLK, 32768,
34 44100 * 512); 36 sample_rate * 512);
35 if (ret < 0) 37 if (ret < 0)
36 pr_err("Failed to start FLL: %d\n", ret); 38 pr_err("Failed to start FLL: %d\n", ret);
37 39
38 ret = snd_soc_dai_set_sysclk(codec_dai, 40 ret = snd_soc_dai_set_sysclk(codec_dai,
39 WM8962_SYSCLK_FLL, 41 WM8962_SYSCLK_FLL,
40 44100 * 512, 42 sample_rate * 512,
41 SND_SOC_CLOCK_IN); 43 SND_SOC_CLOCK_IN);
42 if (ret < 0) { 44 if (ret < 0) {
43 pr_err("Failed to set SYSCLK: %d\n", ret); 45 pr_err("Failed to set SYSCLK: %d\n", ret);
@@ -92,22 +94,7 @@ static int speyside_wm8962_set_bias_level_post(struct snd_soc_card *card,
92static int speyside_wm8962_hw_params(struct snd_pcm_substream *substream, 94static int speyside_wm8962_hw_params(struct snd_pcm_substream *substream,
93 struct snd_pcm_hw_params *params) 95 struct snd_pcm_hw_params *params)
94{ 96{
95 struct snd_soc_pcm_runtime *rtd = substream->private_data; 97 sample_rate = params_rate(params);
96 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
97 struct snd_soc_dai *codec_dai = rtd->codec_dai;
98 int ret;
99
100 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S
101 | SND_SOC_DAIFMT_NB_NF
102 | SND_SOC_DAIFMT_CBM_CFM);
103 if (ret < 0)
104 return ret;
105
106 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S
107 | SND_SOC_DAIFMT_NB_NF
108 | SND_SOC_DAIFMT_CBM_CFM);
109 if (ret < 0)
110 return ret;
111 98
112 return 0; 99 return 0;
113} 100}
@@ -124,12 +111,15 @@ static struct snd_soc_dai_link speyside_wm8962_dai[] = {
124 .codec_dai_name = "wm8962", 111 .codec_dai_name = "wm8962",
125 .platform_name = "samsung-audio", 112 .platform_name = "samsung-audio",
126 .codec_name = "wm8962.1-001a", 113 .codec_name = "wm8962.1-001a",
114 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
115 | SND_SOC_DAIFMT_CBM_CFM,
127 .ops = &speyside_wm8962_ops, 116 .ops = &speyside_wm8962_ops,
128 }, 117 },
129}; 118};
130 119
131static const struct snd_kcontrol_new controls[] = { 120static const struct snd_kcontrol_new controls[] = {
132 SOC_DAPM_PIN_SWITCH("Main Speaker"), 121 SOC_DAPM_PIN_SWITCH("Main Speaker"),
122 SOC_DAPM_PIN_SWITCH("DMIC"),
133}; 123};
134 124
135static struct snd_soc_dapm_widget widgets[] = { 125static struct snd_soc_dapm_widget widgets[] = {
@@ -137,6 +127,7 @@ static struct snd_soc_dapm_widget widgets[] = {
137 SND_SOC_DAPM_MIC("Headset Mic", NULL), 127 SND_SOC_DAPM_MIC("Headset Mic", NULL),
138 128
139 SND_SOC_DAPM_MIC("DMIC", NULL), 129 SND_SOC_DAPM_MIC("DMIC", NULL),
130 SND_SOC_DAPM_MIC("AMIC", NULL),
140 131
141 SND_SOC_DAPM_SPK("Main Speaker", NULL), 132 SND_SOC_DAPM_SPK("Main Speaker", NULL),
142}; 133};
@@ -148,12 +139,16 @@ static struct snd_soc_dapm_route audio_paths[] = {
148 { "Main Speaker", NULL, "SPKOUTL" }, 139 { "Main Speaker", NULL, "SPKOUTL" },
149 { "Main Speaker", NULL, "SPKOUTR" }, 140 { "Main Speaker", NULL, "SPKOUTR" },
150 141
151 { "MICBIAS", NULL, "Headset Mic" }, 142 { "Headset Mic", NULL, "MICBIAS" },
152 { "IN4L", NULL, "MICBIAS" }, 143 { "IN4L", NULL, "Headset Mic" },
153 { "IN4R", NULL, "MICBIAS" }, 144 { "IN4R", NULL, "Headset Mic" },
145
146 { "AMIC", NULL, "MICBIAS" },
147 { "IN1L", NULL, "AMIC" },
148 { "IN1R", NULL, "AMIC" },
154 149
155 { "MICBIAS", NULL, "DMIC" }, 150 { "DMIC", NULL, "MICBIAS" },
156 { "DMICDAT", NULL, "MICBIAS" }, 151 { "DMICDAT", NULL, "DMIC" },
157}; 152};
158 153
159static struct snd_soc_jack speyside_wm8962_headset; 154static struct snd_soc_jack speyside_wm8962_headset;