aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/Kconfig2
-rw-r--r--sound/soc/samsung/ac97.c16
-rw-r--r--sound/soc/samsung/bells.c224
-rw-r--r--sound/soc/samsung/dma.c24
-rw-r--r--sound/soc/samsung/dma.h3
-rw-r--r--sound/soc/samsung/goni_wm8994.c2
-rw-r--r--sound/soc/samsung/h1940_uda1380.c2
-rw-r--r--sound/soc/samsung/i2s.c24
-rw-r--r--sound/soc/samsung/jive_wm8750.c2
-rw-r--r--sound/soc/samsung/littlemill.c2
-rw-r--r--sound/soc/samsung/ln2440sbc_alc650.c2
-rw-r--r--sound/soc/samsung/lowland.c2
-rw-r--r--sound/soc/samsung/neo1973_wm8753.c2
-rw-r--r--sound/soc/samsung/pcm.c21
-rw-r--r--sound/soc/samsung/rx1950_uda1380.c2
-rw-r--r--sound/soc/samsung/s3c2412-i2s.c20
-rw-r--r--sound/soc/samsung/s3c24xx-i2s.c20
-rw-r--r--sound/soc/samsung/s3c24xx_simtec_hermes.c2
-rw-r--r--sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c2
-rw-r--r--sound/soc/samsung/s3c24xx_uda134x.c2
-rw-r--r--sound/soc/samsung/smartq_wm8987.c2
-rw-r--r--sound/soc/samsung/smdk2443_wm9710.c2
-rw-r--r--sound/soc/samsung/smdk_spdif.c2
-rw-r--r--sound/soc/samsung/smdk_wm8580.c6
-rw-r--r--sound/soc/samsung/smdk_wm8580pcm.c2
-rw-r--r--sound/soc/samsung/smdk_wm8994.c4
-rw-r--r--sound/soc/samsung/smdk_wm8994pcm.c2
-rw-r--r--sound/soc/samsung/smdk_wm9713.c2
-rw-r--r--sound/soc/samsung/spdif.c22
-rw-r--r--sound/soc/samsung/speyside.c2
-rw-r--r--sound/soc/samsung/tobermory.c2
31 files changed, 295 insertions, 129 deletions
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index e7b83179aca2..3c7c3a59ed39 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -207,6 +207,8 @@ config SND_SOC_BELLS
207 select SND_SOC_WM5102 207 select SND_SOC_WM5102
208 select SND_SOC_WM5110 208 select SND_SOC_WM5110
209 select SND_SOC_WM9081 209 select SND_SOC_WM9081
210 select SND_SOC_WM0010
211 select SND_SOC_WM1250_EV1
210 212
211config SND_SOC_LOWLAND 213config SND_SOC_LOWLAND
212 tristate "Audio support for Wolfson Lowland" 214 tristate "Audio support for Wolfson Lowland"
diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index 14fbcd30cae5..cd6c7073c50d 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -442,7 +442,7 @@ static __devinit int s3c_ac97_probe(struct platform_device *pdev)
442 ret = -ENODEV; 442 ret = -ENODEV;
443 goto err2; 443 goto err2;
444 } 444 }
445 clk_enable(s3c_ac97.ac97_clk); 445 clk_prepare_enable(s3c_ac97.ac97_clk);
446 446
447 if (ac97_pdata->cfg_gpio(pdev)) { 447 if (ac97_pdata->cfg_gpio(pdev)) {
448 dev_err(&pdev->dev, "Unable to configure gpio\n"); 448 dev_err(&pdev->dev, "Unable to configure gpio\n");
@@ -462,13 +462,20 @@ static __devinit int s3c_ac97_probe(struct platform_device *pdev)
462 if (ret) 462 if (ret)
463 goto err5; 463 goto err5;
464 464
465 return 0; 465 ret = asoc_dma_platform_register(&pdev->dev);
466 if (ret) {
467 dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
468 goto err6;
469 }
466 470
471 return 0;
472err6:
473 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai));
467err5: 474err5:
468 free_irq(irq_res->start, NULL); 475 free_irq(irq_res->start, NULL);
469err4: 476err4:
470err3: 477err3:
471 clk_disable(s3c_ac97.ac97_clk); 478 clk_disable_unprepare(s3c_ac97.ac97_clk);
472 clk_put(s3c_ac97.ac97_clk); 479 clk_put(s3c_ac97.ac97_clk);
473err2: 480err2:
474 iounmap(s3c_ac97.regs); 481 iounmap(s3c_ac97.regs);
@@ -482,13 +489,14 @@ static __devexit int s3c_ac97_remove(struct platform_device *pdev)
482{ 489{
483 struct resource *mem_res, *irq_res; 490 struct resource *mem_res, *irq_res;
484 491
492 asoc_dma_platform_unregister(&pdev->dev);
485 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai)); 493 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai));
486 494
487 irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 495 irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
488 if (irq_res) 496 if (irq_res)
489 free_irq(irq_res->start, NULL); 497 free_irq(irq_res->start, NULL);
490 498
491 clk_disable(s3c_ac97.ac97_clk); 499 clk_disable_unprepare(s3c_ac97.ac97_clk);
492 clk_put(s3c_ac97.ac97_clk); 500 clk_put(s3c_ac97.ac97_clk);
493 501
494 iounmap(s3c_ac97.regs); 502 iounmap(s3c_ac97.regs);
diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c
index 5dc10dfc0d42..01c1c5a2d321 100644
--- a/sound/soc/samsung/bells.c
+++ b/sound/soc/samsung/bells.c
@@ -18,15 +18,6 @@
18#include "../codecs/wm5102.h" 18#include "../codecs/wm5102.h"
19#include "../codecs/wm9081.h" 19#include "../codecs/wm9081.h"
20 20
21/*
22 * 44.1kHz based clocks for the SYSCLK domain, use a very high clock
23 * to allow all the DSP functionality to be enabled if desired.
24 */
25#define SYSCLK_RATE (44100 * 1024)
26
27/* 48kHz based clocks for the ASYNC domain */
28#define ASYNCCLK_RATE (48000 * 512)
29
30/* BCLK2 is fixed at this currently */ 21/* BCLK2 is fixed at this currently */
31#define BCLK2_RATE (64 * 8000) 22#define BCLK2_RATE (64 * 8000)
32 23
@@ -36,15 +27,40 @@
36 */ 27 */
37#define MCLK_RATE 24576000 28#define MCLK_RATE 24576000
38 29
39#define WM9081_AUDIO_RATE 44100 30#define SYS_AUDIO_RATE 44100
40#define WM9081_MCLK_RATE (WM9081_AUDIO_RATE * 256) 31#define SYS_MCLK_RATE (SYS_AUDIO_RATE * 512)
32
33#define DAI_AP_DSP 0
34#define DAI_DSP_CODEC 1
35#define DAI_CODEC_CP 2
36#define DAI_CODEC_SUB 3
37
38struct bells_drvdata {
39 int sysclk_rate;
40 int asyncclk_rate;
41};
42
43static struct bells_drvdata wm2200_drvdata = {
44 .sysclk_rate = 22579200,
45};
46
47static struct bells_drvdata wm5102_drvdata = {
48 .sysclk_rate = 45158400,
49 .asyncclk_rate = 49152000,
50};
51
52static struct bells_drvdata wm5110_drvdata = {
53 .sysclk_rate = 135475200,
54 .asyncclk_rate = 147456000,
55};
41 56
42static int bells_set_bias_level(struct snd_soc_card *card, 57static int bells_set_bias_level(struct snd_soc_card *card,
43 struct snd_soc_dapm_context *dapm, 58 struct snd_soc_dapm_context *dapm,
44 enum snd_soc_bias_level level) 59 enum snd_soc_bias_level level)
45{ 60{
46 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; 61 struct snd_soc_dai *codec_dai = card->rtd[DAI_DSP_CODEC].codec_dai;
47 struct snd_soc_codec *codec = codec_dai->codec; 62 struct snd_soc_codec *codec = codec_dai->codec;
63 struct bells_drvdata *bells = card->drvdata;
48 int ret; 64 int ret;
49 65
50 if (dapm->dev != codec_dai->dev) 66 if (dapm->dev != codec_dai->dev)
@@ -52,18 +68,21 @@ static int bells_set_bias_level(struct snd_soc_card *card,
52 68
53 switch (level) { 69 switch (level) {
54 case SND_SOC_BIAS_PREPARE: 70 case SND_SOC_BIAS_PREPARE:
55 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { 71 if (dapm->bias_level != SND_SOC_BIAS_STANDBY)
56 ret = snd_soc_codec_set_pll(codec, WM5102_FLL1, 72 break;
57 ARIZONA_FLL_SRC_MCLK1,
58 MCLK_RATE,
59 SYSCLK_RATE);
60 if (ret < 0)
61 pr_err("Failed to start FLL: %d\n", ret);
62 73
74 ret = snd_soc_codec_set_pll(codec, WM5102_FLL1,
75 ARIZONA_FLL_SRC_MCLK1,
76 MCLK_RATE,
77 bells->sysclk_rate);
78 if (ret < 0)
79 pr_err("Failed to start FLL: %d\n", ret);
80
81 if (bells->asyncclk_rate) {
63 ret = snd_soc_codec_set_pll(codec, WM5102_FLL2, 82 ret = snd_soc_codec_set_pll(codec, WM5102_FLL2,
64 ARIZONA_FLL_SRC_AIF2BCLK, 83 ARIZONA_FLL_SRC_AIF2BCLK,
65 BCLK2_RATE, 84 BCLK2_RATE,
66 ASYNCCLK_RATE); 85 bells->asyncclk_rate);
67 if (ret < 0) 86 if (ret < 0)
68 pr_err("Failed to start FLL: %d\n", ret); 87 pr_err("Failed to start FLL: %d\n", ret);
69 } 88 }
@@ -80,8 +99,9 @@ static int bells_set_bias_level_post(struct snd_soc_card *card,
80 struct snd_soc_dapm_context *dapm, 99 struct snd_soc_dapm_context *dapm,
81 enum snd_soc_bias_level level) 100 enum snd_soc_bias_level level)
82{ 101{
83 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; 102 struct snd_soc_dai *codec_dai = card->rtd[DAI_DSP_CODEC].codec_dai;
84 struct snd_soc_codec *codec = codec_dai->codec; 103 struct snd_soc_codec *codec = codec_dai->codec;
104 struct bells_drvdata *bells = card->drvdata;
85 int ret; 105 int ret;
86 106
87 if (dapm->dev != codec_dai->dev) 107 if (dapm->dev != codec_dai->dev)
@@ -95,10 +115,13 @@ static int bells_set_bias_level_post(struct snd_soc_card *card,
95 return ret; 115 return ret;
96 } 116 }
97 117
98 ret = snd_soc_codec_set_pll(codec, WM5102_FLL2, 0, 0, 0); 118 if (bells->asyncclk_rate) {
99 if (ret < 0) { 119 ret = snd_soc_codec_set_pll(codec, WM5102_FLL2,
100 pr_err("Failed to stop FLL: %d\n", ret); 120 0, 0, 0);
101 return ret; 121 if (ret < 0) {
122 pr_err("Failed to stop FLL: %d\n", ret);
123 return ret;
124 }
102 } 125 }
103 break; 126 break;
104 127
@@ -113,56 +136,73 @@ static int bells_set_bias_level_post(struct snd_soc_card *card,
113 136
114static int bells_late_probe(struct snd_soc_card *card) 137static int bells_late_probe(struct snd_soc_card *card)
115{ 138{
116 struct snd_soc_codec *codec = card->rtd[0].codec; 139 struct bells_drvdata *bells = card->drvdata;
117 struct snd_soc_dai *aif1_dai = card->rtd[0].codec_dai; 140 struct snd_soc_codec *wm0010 = card->rtd[DAI_AP_DSP].codec;
118 struct snd_soc_dai *aif2_dai = card->rtd[1].cpu_dai; 141 struct snd_soc_codec *codec = card->rtd[DAI_DSP_CODEC].codec;
119 struct snd_soc_dai *aif3_dai = card->rtd[2].cpu_dai; 142 struct snd_soc_dai *aif1_dai = card->rtd[DAI_DSP_CODEC].codec_dai;
120 struct snd_soc_dai *wm9081_dai = card->rtd[2].codec_dai; 143 struct snd_soc_dai *aif2_dai;
144 struct snd_soc_dai *aif3_dai;
145 struct snd_soc_dai *wm9081_dai;
121 int ret; 146 int ret;
122 147
123 ret = snd_soc_dai_set_sysclk(aif1_dai, ARIZONA_CLK_SYSCLK, 0, 0); 148 ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_SYSCLK,
149 ARIZONA_CLK_SRC_FLL1,
150 bells->sysclk_rate,
151 SND_SOC_CLOCK_IN);
124 if (ret != 0) { 152 if (ret != 0) {
125 dev_err(aif1_dai->dev, "Failed to set AIF1 clock: %d\n", ret); 153 dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret);
126 return ret; 154 return ret;
127 } 155 }
128 156
129 ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0); 157 ret = snd_soc_codec_set_sysclk(wm0010, 0, 0, SYS_MCLK_RATE, 0);
130 if (ret != 0) { 158 if (ret != 0) {
131 dev_err(aif2_dai->dev, "Failed to set AIF2 clock: %d\n", ret); 159 dev_err(wm0010->dev, "Failed to set WM0010 clock: %d\n", ret);
132 return ret; 160 return ret;
133 } 161 }
134 162
135 ret = snd_soc_dai_set_sysclk(aif3_dai, ARIZONA_CLK_SYSCLK, 0, 0); 163 ret = snd_soc_dai_set_sysclk(aif1_dai, ARIZONA_CLK_SYSCLK, 0, 0);
136 if (ret != 0) { 164 if (ret != 0)
137 dev_err(aif1_dai->dev, "Failed to set AIF1 clock: %d\n", ret); 165 dev_err(aif1_dai->dev, "Failed to set AIF1 clock: %d\n", ret);
138 return ret;
139 }
140 166
141 ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_SYSCLK, 167 ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_OPCLK, 0,
142 ARIZONA_CLK_SRC_FLL1, SYSCLK_RATE, 168 SYS_MCLK_RATE, SND_SOC_CLOCK_OUT);
169 if (ret != 0)
170 dev_err(codec->dev, "Failed to set OPCLK: %d\n", ret);
171
172 if (card->num_rtd == DAI_CODEC_CP)
173 return 0;
174
175 ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_ASYNCCLK,
176 ARIZONA_CLK_SRC_FLL2,
177 bells->asyncclk_rate,
143 SND_SOC_CLOCK_IN); 178 SND_SOC_CLOCK_IN);
144 if (ret != 0) { 179 if (ret != 0) {
145 dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret); 180 dev_err(codec->dev, "Failed to set ASYNCCLK: %d\n", ret);
146 return ret; 181 return ret;
147 } 182 }
148 183
149 ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_OPCLK, 0, 184 aif2_dai = card->rtd[DAI_CODEC_CP].cpu_dai;
150 WM9081_MCLK_RATE, SND_SOC_CLOCK_OUT); 185
186 ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0);
151 if (ret != 0) { 187 if (ret != 0) {
152 dev_err(codec->dev, "Failed to set OPCLK: %d\n", ret); 188 dev_err(aif2_dai->dev, "Failed to set AIF2 clock: %d\n", ret);
153 return ret; 189 return ret;
154 } 190 }
155 191
156 ret = snd_soc_codec_set_sysclk(codec, ARIZONA_CLK_ASYNCCLK, 192 if (card->num_rtd == DAI_CODEC_SUB)
157 ARIZONA_CLK_SRC_FLL2, ASYNCCLK_RATE, 193 return 0;
158 SND_SOC_CLOCK_IN); 194
195 aif3_dai = card->rtd[DAI_CODEC_SUB].cpu_dai;
196 wm9081_dai = card->rtd[DAI_CODEC_SUB].codec_dai;
197
198 ret = snd_soc_dai_set_sysclk(aif3_dai, ARIZONA_CLK_SYSCLK, 0, 0);
159 if (ret != 0) { 199 if (ret != 0) {
160 dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret); 200 dev_err(aif1_dai->dev, "Failed to set AIF1 clock: %d\n", ret);
161 return ret; 201 return ret;
162 } 202 }
163 203
164 ret = snd_soc_codec_set_sysclk(wm9081_dai->codec, WM9081_SYSCLK_MCLK, 204 ret = snd_soc_codec_set_sysclk(wm9081_dai->codec, WM9081_SYSCLK_MCLK,
165 0, WM9081_MCLK_RATE, 0); 205 0, SYS_MCLK_RATE, 0);
166 if (ret != 0) { 206 if (ret != 0) {
167 dev_err(wm9081_dai->dev, "Failed to set MCLK: %d\n", ret); 207 dev_err(wm9081_dai->dev, "Failed to set MCLK: %d\n", ret);
168 return ret; 208 return ret;
@@ -181,22 +221,57 @@ static const struct snd_soc_pcm_stream baseband_params = {
181 221
182static const struct snd_soc_pcm_stream sub_params = { 222static const struct snd_soc_pcm_stream sub_params = {
183 .formats = SNDRV_PCM_FMTBIT_S32_LE, 223 .formats = SNDRV_PCM_FMTBIT_S32_LE,
184 .rate_min = WM9081_AUDIO_RATE, 224 .rate_min = SYS_AUDIO_RATE,
185 .rate_max = WM9081_AUDIO_RATE, 225 .rate_max = SYS_AUDIO_RATE,
186 .channels_min = 2, 226 .channels_min = 2,
187 .channels_max = 2, 227 .channels_max = 2,
188}; 228};
189 229
230static struct snd_soc_dai_link bells_dai_wm2200[] = {
231 {
232 .name = "CPU-DSP",
233 .stream_name = "CPU-DSP",
234 .cpu_dai_name = "samsung-i2s.0",
235 .codec_dai_name = "wm0010-sdi1",
236 .platform_name = "samsung-i2s.0",
237 .codec_name = "spi0.0",
238 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
239 | SND_SOC_DAIFMT_CBM_CFM,
240 },
241 {
242 .name = "DSP-CODEC",
243 .stream_name = "DSP-CODEC",
244 .cpu_dai_name = "wm0010-sdi2",
245 .codec_dai_name = "wm2200",
246 .codec_name = "wm2200.1-003a",
247 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
248 | SND_SOC_DAIFMT_CBM_CFM,
249 .params = &sub_params,
250 .ignore_suspend = 1,
251 },
252};
253
190static struct snd_soc_dai_link bells_dai_wm5102[] = { 254static struct snd_soc_dai_link bells_dai_wm5102[] = {
191 { 255 {
192 .name = "CPU", 256 .name = "CPU-DSP",
193 .stream_name = "CPU", 257 .stream_name = "CPU-DSP",
194 .cpu_dai_name = "samsung-i2s.0", 258 .cpu_dai_name = "samsung-i2s.0",
259 .codec_dai_name = "wm0010-sdi1",
260 .platform_name = "samsung-i2s.0",
261 .codec_name = "spi0.0",
262 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
263 | SND_SOC_DAIFMT_CBM_CFM,
264 },
265 {
266 .name = "DSP-CODEC",
267 .stream_name = "DSP-CODEC",
268 .cpu_dai_name = "wm0010-sdi2",
195 .codec_dai_name = "wm5102-aif1", 269 .codec_dai_name = "wm5102-aif1",
196 .platform_name = "samsung-audio",
197 .codec_name = "wm5102-codec", 270 .codec_name = "wm5102-codec",
198 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF 271 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
199 | SND_SOC_DAIFMT_CBM_CFM, 272 | SND_SOC_DAIFMT_CBM_CFM,
273 .params = &sub_params,
274 .ignore_suspend = 1,
200 }, 275 },
201 { 276 {
202 .name = "Baseband", 277 .name = "Baseband",
@@ -224,14 +299,25 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
224 299
225static struct snd_soc_dai_link bells_dai_wm5110[] = { 300static struct snd_soc_dai_link bells_dai_wm5110[] = {
226 { 301 {
227 .name = "CPU", 302 .name = "CPU-DSP",
228 .stream_name = "CPU", 303 .stream_name = "CPU-DSP",
229 .cpu_dai_name = "samsung-i2s.0", 304 .cpu_dai_name = "samsung-i2s.0",
305 .codec_dai_name = "wm0010-sdi1",
306 .platform_name = "samsung-i2s.0",
307 .codec_name = "spi0.0",
308 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
309 | SND_SOC_DAIFMT_CBM_CFM,
310 },
311 {
312 .name = "DSP-CODEC",
313 .stream_name = "DSP-CODEC",
314 .cpu_dai_name = "wm0010-sdi2",
230 .codec_dai_name = "wm5110-aif1", 315 .codec_dai_name = "wm5110-aif1",
231 .platform_name = "samsung-audio",
232 .codec_name = "wm5110-codec", 316 .codec_name = "wm5110-codec",
233 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF 317 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
234 | SND_SOC_DAIFMT_CBM_CFM, 318 | SND_SOC_DAIFMT_CBM_CFM,
319 .params = &sub_params,
320 .ignore_suspend = 1,
235 }, 321 },
236 { 322 {
237 .name = "Baseband", 323 .name = "Baseband",
@@ -247,7 +333,7 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
247 { 333 {
248 .name = "Sub", 334 .name = "Sub",
249 .stream_name = "Sub", 335 .stream_name = "Sub",
250 .cpu_dai_name = "wm5102-aif3", 336 .cpu_dai_name = "wm5110-aif3",
251 .codec_dai_name = "wm9081-hifi", 337 .codec_dai_name = "wm9081-hifi",
252 .codec_name = "wm9081.1-006c", 338 .codec_name = "wm9081.1-006c",
253 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF 339 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -270,6 +356,24 @@ static struct snd_soc_dapm_route bells_routes[] = {
270 356
271static struct snd_soc_card bells_cards[] = { 357static struct snd_soc_card bells_cards[] = {
272 { 358 {
359 .name = "Bells WM2200",
360 .owner = THIS_MODULE,
361 .dai_link = bells_dai_wm2200,
362 .num_links = ARRAY_SIZE(bells_dai_wm2200),
363 .codec_conf = bells_codec_conf,
364 .num_configs = ARRAY_SIZE(bells_codec_conf),
365
366 .late_probe = bells_late_probe,
367
368 .dapm_routes = bells_routes,
369 .num_dapm_routes = ARRAY_SIZE(bells_routes),
370
371 .set_bias_level = bells_set_bias_level,
372 .set_bias_level_post = bells_set_bias_level_post,
373
374 .drvdata = &wm2200_drvdata,
375 },
376 {
273 .name = "Bells WM5102", 377 .name = "Bells WM5102",
274 .owner = THIS_MODULE, 378 .owner = THIS_MODULE,
275 .dai_link = bells_dai_wm5102, 379 .dai_link = bells_dai_wm5102,
@@ -284,6 +388,8 @@ static struct snd_soc_card bells_cards[] = {
284 388
285 .set_bias_level = bells_set_bias_level, 389 .set_bias_level = bells_set_bias_level,
286 .set_bias_level_post = bells_set_bias_level_post, 390 .set_bias_level_post = bells_set_bias_level_post,
391
392 .drvdata = &wm5102_drvdata,
287 }, 393 },
288 { 394 {
289 .name = "Bells WM5110", 395 .name = "Bells WM5110",
@@ -300,6 +406,8 @@ static struct snd_soc_card bells_cards[] = {
300 406
301 .set_bias_level = bells_set_bias_level, 407 .set_bias_level = bells_set_bias_level,
302 .set_bias_level_post = bells_set_bias_level_post, 408 .set_bias_level_post = bells_set_bias_level_post,
409
410 .drvdata = &wm5110_drvdata,
303 }, 411 },
304}; 412};
305 413
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index b70964ea448c..64529904a95f 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -432,30 +432,18 @@ static struct snd_soc_platform_driver samsung_asoc_platform = {
432 .pcm_free = dma_free_dma_buffers, 432 .pcm_free = dma_free_dma_buffers,
433}; 433};
434 434
435static int __devinit samsung_asoc_platform_probe(struct platform_device *pdev) 435int __devinit asoc_dma_platform_register(struct device *dev)
436{ 436{
437 return snd_soc_register_platform(&pdev->dev, &samsung_asoc_platform); 437 return snd_soc_register_platform(dev, &samsung_asoc_platform);
438} 438}
439EXPORT_SYMBOL_GPL(asoc_dma_platform_register);
439 440
440static int __devexit samsung_asoc_platform_remove(struct platform_device *pdev) 441void __devexit asoc_dma_platform_unregister(struct device *dev)
441{ 442{
442 snd_soc_unregister_platform(&pdev->dev); 443 snd_soc_unregister_platform(dev);
443 return 0;
444} 444}
445 445EXPORT_SYMBOL_GPL(asoc_dma_platform_unregister);
446static struct platform_driver asoc_dma_driver = {
447 .driver = {
448 .name = "samsung-audio",
449 .owner = THIS_MODULE,
450 },
451
452 .probe = samsung_asoc_platform_probe,
453 .remove = __devexit_p(samsung_asoc_platform_remove),
454};
455
456module_platform_driver(asoc_dma_driver);
457 446
458MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); 447MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
459MODULE_DESCRIPTION("Samsung ASoC DMA Driver"); 448MODULE_DESCRIPTION("Samsung ASoC DMA Driver");
460MODULE_LICENSE("GPL"); 449MODULE_LICENSE("GPL");
461MODULE_ALIAS("platform:samsung-audio");
diff --git a/sound/soc/samsung/dma.h b/sound/soc/samsung/dma.h
index 7d1ead77ef21..73d8c7c8a1e8 100644
--- a/sound/soc/samsung/dma.h
+++ b/sound/soc/samsung/dma.h
@@ -21,4 +21,7 @@ struct s3c_dma_params {
21 struct samsung_dma_ops *ops; 21 struct samsung_dma_ops *ops;
22}; 22};
23 23
24int asoc_dma_platform_register(struct device *dev);
25void asoc_dma_platform_unregister(struct device *dev);
26
24#endif 27#endif
diff --git a/sound/soc/samsung/goni_wm8994.c b/sound/soc/samsung/goni_wm8994.c
index c23c2ae91f58..d37ede58e0a8 100644
--- a/sound/soc/samsung/goni_wm8994.c
+++ b/sound/soc/samsung/goni_wm8994.c
@@ -228,7 +228,7 @@ static struct snd_soc_dai_link goni_dai[] = {
228 .stream_name = "WM8994 HiFi", 228 .stream_name = "WM8994 HiFi",
229 .cpu_dai_name = "samsung-i2s.0", 229 .cpu_dai_name = "samsung-i2s.0",
230 .codec_dai_name = "wm8994-aif1", 230 .codec_dai_name = "wm8994-aif1",
231 .platform_name = "samsung-audio", 231 .platform_name = "samsung-i2s.0",
232 .codec_name = "wm8994-codec.0-001a", 232 .codec_name = "wm8994-codec.0-001a",
233 .init = goni_wm8994_init, 233 .init = goni_wm8994_init,
234 .ops = &goni_hifi_ops, 234 .ops = &goni_hifi_ops,
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c
index 6e3257717c54..3870e9678b5d 100644
--- a/sound/soc/samsung/h1940_uda1380.c
+++ b/sound/soc/samsung/h1940_uda1380.c
@@ -207,7 +207,7 @@ static struct snd_soc_dai_link h1940_uda1380_dai[] = {
207 .cpu_dai_name = "s3c24xx-iis", 207 .cpu_dai_name = "s3c24xx-iis",
208 .codec_dai_name = "uda1380-hifi", 208 .codec_dai_name = "uda1380-hifi",
209 .init = h1940_uda1380_init, 209 .init = h1940_uda1380_init,
210 .platform_name = "samsung-audio", 210 .platform_name = "s3c24xx-iis",
211 .codec_name = "uda1380-codec.0-001a", 211 .codec_name = "uda1380-codec.0-001a",
212 .ops = &h1940_ops, 212 .ops = &h1940_ops,
213 }, 213 },
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 40b00a13dcd1..0aa0451823ce 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -49,8 +49,6 @@ struct i2s_dai {
49 struct clk *clk; 49 struct clk *clk;
50 /* Clock for generating I2S signals */ 50 /* Clock for generating I2S signals */
51 struct clk *op_clk; 51 struct clk *op_clk;
52 /* Array of clock names for op_clk */
53 const char **src_clk;
54 /* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */ 52 /* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */
55 struct i2s_dai *pri_dai; 53 struct i2s_dai *pri_dai;
56 /* Pointer to the Secondary_Fifo if it has one, NULL otherwise */ 54 /* Pointer to the Secondary_Fifo if it has one, NULL otherwise */
@@ -423,7 +421,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
423 if (i2s->op_clk) { 421 if (i2s->op_clk) {
424 if ((clk_id && !(mod & MOD_IMS_SYSMUX)) || 422 if ((clk_id && !(mod & MOD_IMS_SYSMUX)) ||
425 (!clk_id && (mod & MOD_IMS_SYSMUX))) { 423 (!clk_id && (mod & MOD_IMS_SYSMUX))) {
426 clk_disable(i2s->op_clk); 424 clk_disable_unprepare(i2s->op_clk);
427 clk_put(i2s->op_clk); 425 clk_put(i2s->op_clk);
428 } else { 426 } else {
429 i2s->rclk_srcrate = 427 i2s->rclk_srcrate =
@@ -432,9 +430,13 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
432 } 430 }
433 } 431 }
434 432
435 i2s->op_clk = clk_get(&i2s->pdev->dev, 433 if (clk_id)
436 i2s->src_clk[clk_id]); 434 i2s->op_clk = clk_get(&i2s->pdev->dev,
437 clk_enable(i2s->op_clk); 435 "i2s_opclk1");
436 else
437 i2s->op_clk = clk_get(&i2s->pdev->dev,
438 "i2s_opclk0");
439 clk_prepare_enable(i2s->op_clk);
438 i2s->rclk_srcrate = clk_get_rate(i2s->op_clk); 440 i2s->rclk_srcrate = clk_get_rate(i2s->op_clk);
439 441
440 /* Over-ride the other's */ 442 /* Over-ride the other's */
@@ -880,7 +882,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
880 iounmap(i2s->addr); 882 iounmap(i2s->addr);
881 return -ENOENT; 883 return -ENOENT;
882 } 884 }
883 clk_enable(i2s->clk); 885 clk_prepare_enable(i2s->clk);
884 886
885 if (other) { 887 if (other) {
886 other->addr = i2s->addr; 888 other->addr = i2s->addr;
@@ -922,7 +924,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
922 if (i2s->quirks & QUIRK_NEED_RSTCLR) 924 if (i2s->quirks & QUIRK_NEED_RSTCLR)
923 writel(0, i2s->addr + I2SCON); 925 writel(0, i2s->addr + I2SCON);
924 926
925 clk_disable(i2s->clk); 927 clk_disable_unprepare(i2s->clk);
926 clk_put(i2s->clk); 928 clk_put(i2s->clk);
927 929
928 iounmap(i2s->addr); 930 iounmap(i2s->addr);
@@ -1007,6 +1009,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
1007 sec_dai = dev_get_drvdata(&pdev->dev); 1009 sec_dai = dev_get_drvdata(&pdev->dev);
1008 snd_soc_register_dai(&sec_dai->pdev->dev, 1010 snd_soc_register_dai(&sec_dai->pdev->dev,
1009 &sec_dai->i2s_dai_drv); 1011 &sec_dai->i2s_dai_drv);
1012 asoc_dma_platform_register(&pdev->dev);
1010 return 0; 1013 return 0;
1011 } 1014 }
1012 1015
@@ -1067,7 +1070,6 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
1067 (struct s3c2410_dma_client *)&pri_dai->dma_capture; 1070 (struct s3c2410_dma_client *)&pri_dai->dma_capture;
1068 pri_dai->dma_playback.channel = dma_pl_chan; 1071 pri_dai->dma_playback.channel = dma_pl_chan;
1069 pri_dai->dma_capture.channel = dma_cp_chan; 1072 pri_dai->dma_capture.channel = dma_cp_chan;
1070 pri_dai->src_clk = i2s_cfg->src_clk;
1071 pri_dai->dma_playback.dma_size = 4; 1073 pri_dai->dma_playback.dma_size = 4;
1072 pri_dai->dma_capture.dma_size = 4; 1074 pri_dai->dma_capture.dma_size = 4;
1073 pri_dai->base = regs_base; 1075 pri_dai->base = regs_base;
@@ -1088,7 +1090,6 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
1088 (struct s3c2410_dma_client *)&sec_dai->dma_playback; 1090 (struct s3c2410_dma_client *)&sec_dai->dma_playback;
1089 /* Use iDMA always if SysDMA not provided */ 1091 /* Use iDMA always if SysDMA not provided */
1090 sec_dai->dma_playback.channel = dma_pl_sec_chan ? : -1; 1092 sec_dai->dma_playback.channel = dma_pl_sec_chan ? : -1;
1091 sec_dai->src_clk = i2s_cfg->src_clk;
1092 sec_dai->dma_playback.dma_size = 4; 1093 sec_dai->dma_playback.dma_size = 4;
1093 sec_dai->base = regs_base; 1094 sec_dai->base = regs_base;
1094 sec_dai->quirks = quirks; 1095 sec_dai->quirks = quirks;
@@ -1107,6 +1108,8 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
1107 1108
1108 pm_runtime_enable(&pdev->dev); 1109 pm_runtime_enable(&pdev->dev);
1109 1110
1111 asoc_dma_platform_register(&pdev->dev);
1112
1110 return 0; 1113 return 0;
1111err: 1114err:
1112 release_mem_region(regs_base, resource_size(res)); 1115 release_mem_region(regs_base, resource_size(res));
@@ -1135,6 +1138,7 @@ static __devexit int samsung_i2s_remove(struct platform_device *pdev)
1135 i2s->pri_dai = NULL; 1138 i2s->pri_dai = NULL;
1136 i2s->sec_dai = NULL; 1139 i2s->sec_dai = NULL;
1137 1140
1141 asoc_dma_platform_unregister(&pdev->dev);
1138 snd_soc_unregister_dai(&pdev->dev); 1142 snd_soc_unregister_dai(&pdev->dev);
1139 1143
1140 return 0; 1144 return 0;
diff --git a/sound/soc/samsung/jive_wm8750.c b/sound/soc/samsung/jive_wm8750.c
index 1578663a1faa..b5f6abd9d221 100644
--- a/sound/soc/samsung/jive_wm8750.c
+++ b/sound/soc/samsung/jive_wm8750.c
@@ -118,7 +118,7 @@ static struct snd_soc_dai_link jive_dai = {
118 .stream_name = "WM8750", 118 .stream_name = "WM8750",
119 .cpu_dai_name = "s3c2412-i2s", 119 .cpu_dai_name = "s3c2412-i2s",
120 .codec_dai_name = "wm8750-hifi", 120 .codec_dai_name = "wm8750-hifi",
121 .platform_name = "samsung-audio", 121 .platform_name = "s3c2412-i2s",
122 .codec_name = "wm8750.0-001a", 122 .codec_name = "wm8750.0-001a",
123 .init = jive_wm8750_init, 123 .init = jive_wm8750_init,
124 .ops = &jive_ops, 124 .ops = &jive_ops,
diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c
index 7beb6d9b57a8..de4cfdf5fdfc 100644
--- a/sound/soc/samsung/littlemill.c
+++ b/sound/soc/samsung/littlemill.c
@@ -145,7 +145,7 @@ static struct snd_soc_dai_link littlemill_dai[] = {
145 .stream_name = "CPU", 145 .stream_name = "CPU",
146 .cpu_dai_name = "samsung-i2s.0", 146 .cpu_dai_name = "samsung-i2s.0",
147 .codec_dai_name = "wm8994-aif1", 147 .codec_dai_name = "wm8994-aif1",
148 .platform_name = "samsung-audio", 148 .platform_name = "samsung-i2s.0",
149 .codec_name = "wm8994-codec", 149 .codec_name = "wm8994-codec",
150 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF 150 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
151 | SND_SOC_DAIFMT_CBM_CFM, 151 | SND_SOC_DAIFMT_CBM_CFM,
diff --git a/sound/soc/samsung/ln2440sbc_alc650.c b/sound/soc/samsung/ln2440sbc_alc650.c
index 69c4a5934a4d..9342fc270c2b 100644
--- a/sound/soc/samsung/ln2440sbc_alc650.c
+++ b/sound/soc/samsung/ln2440sbc_alc650.c
@@ -28,7 +28,7 @@ static struct snd_soc_dai_link ln2440sbc_dai[] = {
28 .cpu_dai_name = "samsung-ac97", 28 .cpu_dai_name = "samsung-ac97",
29 .codec_dai_name = "ac97-hifi", 29 .codec_dai_name = "ac97-hifi",
30 .codec_name = "ac97-codec", 30 .codec_name = "ac97-codec",
31 .platform_name = "samsung-audio", 31 .platform_name = "samsung-ac97",
32}, 32},
33}; 33};
34 34
diff --git a/sound/soc/samsung/lowland.c b/sound/soc/samsung/lowland.c
index 6abf341c4a2a..a71c31af4e0e 100644
--- a/sound/soc/samsung/lowland.c
+++ b/sound/soc/samsung/lowland.c
@@ -99,7 +99,7 @@ static struct snd_soc_dai_link lowland_dai[] = {
99 .stream_name = "CPU", 99 .stream_name = "CPU",
100 .cpu_dai_name = "samsung-i2s.0", 100 .cpu_dai_name = "samsung-i2s.0",
101 .codec_dai_name = "wm5100-aif1", 101 .codec_dai_name = "wm5100-aif1",
102 .platform_name = "samsung-audio", 102 .platform_name = "samsung-i2s.0",
103 .codec_name = "wm5100.1-001a", 103 .codec_name = "wm5100.1-001a",
104 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 104 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
105 SND_SOC_DAIFMT_CBM_CFM, 105 SND_SOC_DAIFMT_CBM_CFM,
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c
index 321d51134e47..c7e965f80d2e 100644
--- a/sound/soc/samsung/neo1973_wm8753.c
+++ b/sound/soc/samsung/neo1973_wm8753.c
@@ -364,7 +364,7 @@ static struct snd_soc_dai_link neo1973_dai[] = {
364{ /* Hifi Playback - for similatious use with voice below */ 364{ /* Hifi Playback - for similatious use with voice below */
365 .name = "WM8753", 365 .name = "WM8753",
366 .stream_name = "WM8753 HiFi", 366 .stream_name = "WM8753 HiFi",
367 .platform_name = "samsung-audio", 367 .platform_name = "s3c24xx-iis",
368 .cpu_dai_name = "s3c24xx-iis", 368 .cpu_dai_name = "s3c24xx-iis",
369 .codec_dai_name = "wm8753-hifi", 369 .codec_dai_name = "wm8753-hifi",
370 .codec_name = "wm8753.0-001a", 370 .codec_name = "wm8753.0-001a",
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index c86081992dfd..ecd509048771 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -543,7 +543,7 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev)
543 ret = PTR_ERR(pcm->cclk); 543 ret = PTR_ERR(pcm->cclk);
544 goto err1; 544 goto err1;
545 } 545 }
546 clk_enable(pcm->cclk); 546 clk_prepare_enable(pcm->cclk);
547 547
548 /* record our pcm structure for later use in the callbacks */ 548 /* record our pcm structure for later use in the callbacks */
549 dev_set_drvdata(&pdev->dev, pcm); 549 dev_set_drvdata(&pdev->dev, pcm);
@@ -568,7 +568,7 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev)
568 ret = -ENOENT; 568 ret = -ENOENT;
569 goto err4; 569 goto err4;
570 } 570 }
571 clk_enable(pcm->pclk); 571 clk_prepare_enable(pcm->pclk);
572 572
573 s3c_pcm_stereo_in[pdev->id].dma_addr = mem_res->start 573 s3c_pcm_stereo_in[pdev->id].dma_addr = mem_res->start
574 + S3C_PCM_RXFIFO; 574 + S3C_PCM_RXFIFO;
@@ -589,17 +589,25 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev)
589 goto err5; 589 goto err5;
590 } 590 }
591 591
592 ret = asoc_dma_platform_register(&pdev->dev);
593 if (ret) {
594 dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
595 goto err6;
596 }
597
592 return 0; 598 return 0;
593 599
600err6:
601 snd_soc_unregister_dai(&pdev->dev);
594err5: 602err5:
595 clk_disable(pcm->pclk); 603 clk_disable_unprepare(pcm->pclk);
596 clk_put(pcm->pclk); 604 clk_put(pcm->pclk);
597err4: 605err4:
598 iounmap(pcm->regs); 606 iounmap(pcm->regs);
599err3: 607err3:
600 release_mem_region(mem_res->start, resource_size(mem_res)); 608 release_mem_region(mem_res->start, resource_size(mem_res));
601err2: 609err2:
602 clk_disable(pcm->cclk); 610 clk_disable_unprepare(pcm->cclk);
603 clk_put(pcm->cclk); 611 clk_put(pcm->cclk);
604err1: 612err1:
605 return ret; 613 return ret;
@@ -610,6 +618,7 @@ static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev)
610 struct s3c_pcm_info *pcm = &s3c_pcm[pdev->id]; 618 struct s3c_pcm_info *pcm = &s3c_pcm[pdev->id];
611 struct resource *mem_res; 619 struct resource *mem_res;
612 620
621 asoc_dma_platform_unregister(&pdev->dev);
613 snd_soc_unregister_dai(&pdev->dev); 622 snd_soc_unregister_dai(&pdev->dev);
614 623
615 pm_runtime_disable(&pdev->dev); 624 pm_runtime_disable(&pdev->dev);
@@ -619,8 +628,8 @@ static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev)
619 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 628 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
620 release_mem_region(mem_res->start, resource_size(mem_res)); 629 release_mem_region(mem_res->start, resource_size(mem_res));
621 630
622 clk_disable(pcm->cclk); 631 clk_disable_unprepare(pcm->cclk);
623 clk_disable(pcm->pclk); 632 clk_disable_unprepare(pcm->pclk);
624 clk_put(pcm->pclk); 633 clk_put(pcm->pclk);
625 clk_put(pcm->cclk); 634 clk_put(pcm->cclk);
626 635
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c
index 21e12361a9cd..a5826ea9cad6 100644
--- a/sound/soc/samsung/rx1950_uda1380.c
+++ b/sound/soc/samsung/rx1950_uda1380.c
@@ -85,7 +85,7 @@ static struct snd_soc_dai_link rx1950_uda1380_dai[] = {
85 .cpu_dai_name = "s3c24xx-iis", 85 .cpu_dai_name = "s3c24xx-iis",
86 .codec_dai_name = "uda1380-hifi", 86 .codec_dai_name = "uda1380-hifi",
87 .init = rx1950_uda1380_init, 87 .init = rx1950_uda1380_init,
88 .platform_name = "samsung-audio", 88 .platform_name = "s3c24xx-iis",
89 .codec_name = "uda1380-codec.0-001a", 89 .codec_name = "uda1380-codec.0-001a",
90 .ops = &rx1950_ops, 90 .ops = &rx1950_ops,
91 }, 91 },
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c
index ac7701b3c5dc..edf5f527c5a2 100644
--- a/sound/soc/samsung/s3c2412-i2s.c
+++ b/sound/soc/samsung/s3c2412-i2s.c
@@ -162,11 +162,29 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = {
162 162
163static __devinit int s3c2412_iis_dev_probe(struct platform_device *pdev) 163static __devinit int s3c2412_iis_dev_probe(struct platform_device *pdev)
164{ 164{
165 return s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai); 165 int ret = 0;
166
167 ret = s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai);
168 if (ret) {
169 pr_err("failed to register the dai\n");
170 return ret;
171 }
172
173 ret = asoc_dma_platform_register(&pdev->dev);
174 if (ret) {
175 pr_err("failed to register the DMA: %d\n", ret);
176 goto err;
177 }
178
179 return 0;
180err:
181 snd_soc_unregister_dai(&pdev->dev);
182 return ret;
166} 183}
167 184
168static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev) 185static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev)
169{ 186{
187 asoc_dma_platform_unregister(&pdev->dev);
170 snd_soc_unregister_dai(&pdev->dev); 188 snd_soc_unregister_dai(&pdev->dev);
171 return 0; 189 return 0;
172} 190}
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c
index 0aae3a3883dc..0022d51fd160 100644
--- a/sound/soc/samsung/s3c24xx-i2s.c
+++ b/sound/soc/samsung/s3c24xx-i2s.c
@@ -467,11 +467,29 @@ static struct snd_soc_dai_driver s3c24xx_i2s_dai = {
467 467
468static __devinit int s3c24xx_iis_dev_probe(struct platform_device *pdev) 468static __devinit int s3c24xx_iis_dev_probe(struct platform_device *pdev)
469{ 469{
470 return snd_soc_register_dai(&pdev->dev, &s3c24xx_i2s_dai); 470 int ret = 0;
471
472 ret = s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai);
473 if (ret) {
474 pr_err("failed to register the dai\n");
475 return ret;
476 }
477
478 ret = asoc_dma_platform_register(&pdev->dev);
479 if (ret) {
480 pr_err("failed to register the dma: %d\n", ret);
481 goto err;
482 }
483
484 return 0;
485err:
486 snd_soc_unregister_dai(&pdev->dev);
487 return ret;
471} 488}
472 489
473static __devexit int s3c24xx_iis_dev_remove(struct platform_device *pdev) 490static __devexit int s3c24xx_iis_dev_remove(struct platform_device *pdev)
474{ 491{
492 asoc_dma_platform_unregister(&pdev->dev);
475 snd_soc_unregister_dai(&pdev->dev); 493 snd_soc_unregister_dai(&pdev->dev);
476 return 0; 494 return 0;
477} 495}
diff --git a/sound/soc/samsung/s3c24xx_simtec_hermes.c b/sound/soc/samsung/s3c24xx_simtec_hermes.c
index 7ace6a87f41b..befabe8979f7 100644
--- a/sound/soc/samsung/s3c24xx_simtec_hermes.c
+++ b/sound/soc/samsung/s3c24xx_simtec_hermes.c
@@ -82,7 +82,7 @@ static struct snd_soc_dai_link simtec_dai_aic33 = {
82 .codec_name = "tlv320aic3x-codec.0-001a", 82 .codec_name = "tlv320aic3x-codec.0-001a",
83 .cpu_dai_name = "s3c24xx-iis", 83 .cpu_dai_name = "s3c24xx-iis",
84 .codec_dai_name = "tlv320aic3x-hifi", 84 .codec_dai_name = "tlv320aic3x-hifi",
85 .platform_name = "samsung-audio", 85 .platform_name = "s3c24xx-iis",
86 .init = simtec_hermes_init, 86 .init = simtec_hermes_init,
87}; 87};
88 88
diff --git a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
index c42d5f00b0e1..5552f82c92a7 100644
--- a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
+++ b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
@@ -71,7 +71,7 @@ static struct snd_soc_dai_link simtec_dai_aic23 = {
71 .codec_name = "tlv320aic3x-codec.0-001a", 71 .codec_name = "tlv320aic3x-codec.0-001a",
72 .cpu_dai_name = "s3c24xx-iis", 72 .cpu_dai_name = "s3c24xx-iis",
73 .codec_dai_name = "tlv320aic3x-hifi", 73 .codec_dai_name = "tlv320aic3x-hifi",
74 .platform_name = "samsung-audio", 74 .platform_name = "s3c24xx-iis",
75 .init = simtec_tlv320aic23_init, 75 .init = simtec_tlv320aic23_init,
76}; 76};
77 77
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c
index d731042e51b0..333e1b7f06c7 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -224,7 +224,7 @@ static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {
224 .codec_dai_name = "uda134x-hifi", 224 .codec_dai_name = "uda134x-hifi",
225 .cpu_dai_name = "s3c24xx-iis", 225 .cpu_dai_name = "s3c24xx-iis",
226 .ops = &s3c24xx_uda134x_ops, 226 .ops = &s3c24xx_uda134x_ops,
227 .platform_name = "samsung-audio", 227 .platform_name = "s3c24xx-iis",
228}; 228};
229 229
230static struct snd_soc_card snd_soc_s3c24xx_uda134x = { 230static struct snd_soc_card snd_soc_s3c24xx_uda134x = {
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
index f2dcb424ea25..58ae3237ef69 100644
--- a/sound/soc/samsung/smartq_wm8987.c
+++ b/sound/soc/samsung/smartq_wm8987.c
@@ -189,7 +189,7 @@ static struct snd_soc_dai_link smartq_dai[] = {
189 .stream_name = "SmartQ Hi-Fi", 189 .stream_name = "SmartQ Hi-Fi",
190 .cpu_dai_name = "samsung-i2s.0", 190 .cpu_dai_name = "samsung-i2s.0",
191 .codec_dai_name = "wm8750-hifi", 191 .codec_dai_name = "wm8750-hifi",
192 .platform_name = "samsung-audio", 192 .platform_name = "samsung-i2s.0",
193 .codec_name = "wm8750.0-0x1a", 193 .codec_name = "wm8750.0-0x1a",
194 .init = smartq_wm8987_init, 194 .init = smartq_wm8987_init,
195 .ops = &smartq_hifi_ops, 195 .ops = &smartq_hifi_ops,
diff --git a/sound/soc/samsung/smdk2443_wm9710.c b/sound/soc/samsung/smdk2443_wm9710.c
index 720ba29bb7e4..c390aad68cfb 100644
--- a/sound/soc/samsung/smdk2443_wm9710.c
+++ b/sound/soc/samsung/smdk2443_wm9710.c
@@ -24,7 +24,7 @@ static struct snd_soc_dai_link smdk2443_dai[] = {
24 .cpu_dai_name = "samsung-ac97", 24 .cpu_dai_name = "samsung-ac97",
25 .codec_dai_name = "ac97-hifi", 25 .codec_dai_name = "ac97-hifi",
26 .codec_name = "ac97-codec", 26 .codec_name = "ac97-codec",
27 .platform_name = "samsung-audio", 27 .platform_name = "samsung-ac97",
28}, 28},
29}; 29};
30 30
diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
index beaa9c15d697..a2f2363fe1c2 100644
--- a/sound/soc/samsung/smdk_spdif.c
+++ b/sound/soc/samsung/smdk_spdif.c
@@ -151,7 +151,7 @@ static struct snd_soc_ops smdk_spdif_ops = {
151static struct snd_soc_dai_link smdk_dai = { 151static struct snd_soc_dai_link smdk_dai = {
152 .name = "S/PDIF", 152 .name = "S/PDIF",
153 .stream_name = "S/PDIF PCM Playback", 153 .stream_name = "S/PDIF PCM Playback",
154 .platform_name = "samsung-audio", 154 .platform_name = "samsung-spdif",
155 .cpu_dai_name = "samsung-spdif", 155 .cpu_dai_name = "samsung-spdif",
156 .codec_dai_name = "dit-hifi", 156 .codec_dai_name = "dit-hifi",
157 .codec_name = "spdif-dit", 157 .codec_name = "spdif-dit",
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c
index ade2809cf393..7e2b710763be 100644
--- a/sound/soc/samsung/smdk_wm8580.c
+++ b/sound/soc/samsung/smdk_wm8580.c
@@ -176,7 +176,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
176 .stream_name = "Playback", 176 .stream_name = "Playback",
177 .cpu_dai_name = "samsung-i2s.0", 177 .cpu_dai_name = "samsung-i2s.0",
178 .codec_dai_name = "wm8580-hifi-playback", 178 .codec_dai_name = "wm8580-hifi-playback",
179 .platform_name = "samsung-audio", 179 .platform_name = "samsung-i2s.0",
180 .codec_name = "wm8580.0-001b", 180 .codec_name = "wm8580.0-001b",
181 .ops = &smdk_ops, 181 .ops = &smdk_ops,
182 }, 182 },
@@ -185,7 +185,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
185 .stream_name = "Capture", 185 .stream_name = "Capture",
186 .cpu_dai_name = "samsung-i2s.0", 186 .cpu_dai_name = "samsung-i2s.0",
187 .codec_dai_name = "wm8580-hifi-capture", 187 .codec_dai_name = "wm8580-hifi-capture",
188 .platform_name = "samsung-audio", 188 .platform_name = "samsung-i2s.0",
189 .codec_name = "wm8580.0-001b", 189 .codec_name = "wm8580.0-001b",
190 .init = smdk_wm8580_init_paiftx, 190 .init = smdk_wm8580_init_paiftx,
191 .ops = &smdk_ops, 191 .ops = &smdk_ops,
@@ -195,7 +195,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
195 .stream_name = "Playback", 195 .stream_name = "Playback",
196 .cpu_dai_name = "samsung-i2s.x", 196 .cpu_dai_name = "samsung-i2s.x",
197 .codec_dai_name = "wm8580-hifi-playback", 197 .codec_dai_name = "wm8580-hifi-playback",
198 .platform_name = "samsung-audio", 198 .platform_name = "samsung-i2s.x",
199 .codec_name = "wm8580.0-001b", 199 .codec_name = "wm8580.0-001b",
200 .ops = &smdk_ops, 200 .ops = &smdk_ops,
201 }, 201 },
diff --git a/sound/soc/samsung/smdk_wm8580pcm.c b/sound/soc/samsung/smdk_wm8580pcm.c
index fab5322e9f05..34239fe9afde 100644
--- a/sound/soc/samsung/smdk_wm8580pcm.c
+++ b/sound/soc/samsung/smdk_wm8580pcm.c
@@ -135,7 +135,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
135 .stream_name = "Capture", 135 .stream_name = "Capture",
136 .cpu_dai_name = "samsung-pcm.0", 136 .cpu_dai_name = "samsung-pcm.0",
137 .codec_dai_name = "wm8580-hifi-capture", 137 .codec_dai_name = "wm8580-hifi-capture",
138 .platform_name = "samsung-audio", 138 .platform_name = "samsung-pcm.0",
139 .codec_name = "wm8580.0-001b", 139 .codec_name = "wm8580.0-001b",
140 .ops = &smdk_wm8580_pcm_ops, 140 .ops = &smdk_wm8580_pcm_ops,
141 }, 141 },
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 48dd4dd9ee08..dd0aa8cb1a9e 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -127,7 +127,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
127 .stream_name = "Pri_Dai", 127 .stream_name = "Pri_Dai",
128 .cpu_dai_name = "samsung-i2s.0", 128 .cpu_dai_name = "samsung-i2s.0",
129 .codec_dai_name = "wm8994-aif1", 129 .codec_dai_name = "wm8994-aif1",
130 .platform_name = "samsung-audio", 130 .platform_name = "samsung-i2s.0",
131 .codec_name = "wm8994-codec", 131 .codec_name = "wm8994-codec",
132 .init = smdk_wm8994_init_paiftx, 132 .init = smdk_wm8994_init_paiftx,
133 .ops = &smdk_ops, 133 .ops = &smdk_ops,
@@ -136,7 +136,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
136 .stream_name = "Sec_Dai", 136 .stream_name = "Sec_Dai",
137 .cpu_dai_name = "samsung-i2s.4", 137 .cpu_dai_name = "samsung-i2s.4",
138 .codec_dai_name = "wm8994-aif1", 138 .codec_dai_name = "wm8994-aif1",
139 .platform_name = "samsung-audio", 139 .platform_name = "samsung-i2s.4",
140 .codec_name = "wm8994-codec", 140 .codec_name = "wm8994-codec",
141 .ops = &smdk_ops, 141 .ops = &smdk_ops,
142 }, 142 },
diff --git a/sound/soc/samsung/smdk_wm8994pcm.c b/sound/soc/samsung/smdk_wm8994pcm.c
index 77ecba935119..15f6b44e9de3 100644
--- a/sound/soc/samsung/smdk_wm8994pcm.c
+++ b/sound/soc/samsung/smdk_wm8994pcm.c
@@ -116,7 +116,7 @@ static struct snd_soc_dai_link smdk_dai[] = {
116 .stream_name = "Primary PCM", 116 .stream_name = "Primary PCM",
117 .cpu_dai_name = "samsung-pcm.0", 117 .cpu_dai_name = "samsung-pcm.0",
118 .codec_dai_name = "wm8994-aif1", 118 .codec_dai_name = "wm8994-aif1",
119 .platform_name = "samsung-audio", 119 .platform_name = "samsung-pcm.0",
120 .codec_name = "wm8994-codec", 120 .codec_name = "wm8994-codec",
121 .ops = &smdk_wm8994_pcm_ops, 121 .ops = &smdk_wm8994_pcm_ops,
122 }, 122 },
diff --git a/sound/soc/samsung/smdk_wm9713.c b/sound/soc/samsung/smdk_wm9713.c
index 55b2ca7f3290..0d20e4ed27aa 100644
--- a/sound/soc/samsung/smdk_wm9713.c
+++ b/sound/soc/samsung/smdk_wm9713.c
@@ -42,7 +42,7 @@ static struct snd_soc_card smdk;
42static struct snd_soc_dai_link smdk_dai = { 42static struct snd_soc_dai_link smdk_dai = {
43 .name = "AC97", 43 .name = "AC97",
44 .stream_name = "AC97 PCM", 44 .stream_name = "AC97 PCM",
45 .platform_name = "samsung-audio", 45 .platform_name = "samsung-ac97",
46 .cpu_dai_name = "samsung-ac97", 46 .cpu_dai_name = "samsung-ac97",
47 .codec_dai_name = "wm9713-hifi", 47 .codec_dai_name = "wm9713-hifi",
48 .codec_name = "wm9713-codec", 48 .codec_name = "wm9713-codec",
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index bc24c7af02b2..8606fc6cb37d 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -397,7 +397,7 @@ static __devinit int spdif_probe(struct platform_device *pdev)
397 ret = -ENOENT; 397 ret = -ENOENT;
398 goto err0; 398 goto err0;
399 } 399 }
400 clk_enable(spdif->pclk); 400 clk_prepare_enable(spdif->pclk);
401 401
402 spdif->sclk = clk_get(&pdev->dev, "sclk_spdif"); 402 spdif->sclk = clk_get(&pdev->dev, "sclk_spdif");
403 if (IS_ERR(spdif->sclk)) { 403 if (IS_ERR(spdif->sclk)) {
@@ -405,7 +405,7 @@ static __devinit int spdif_probe(struct platform_device *pdev)
405 ret = -ENOENT; 405 ret = -ENOENT;
406 goto err1; 406 goto err1;
407 } 407 }
408 clk_enable(spdif->sclk); 408 clk_prepare_enable(spdif->sclk);
409 409
410 /* Request S/PDIF Register's memory region */ 410 /* Request S/PDIF Register's memory region */
411 if (!request_mem_region(mem_res->start, 411 if (!request_mem_region(mem_res->start,
@@ -437,17 +437,24 @@ static __devinit int spdif_probe(struct platform_device *pdev)
437 437
438 spdif->dma_playback = &spdif_stereo_out; 438 spdif->dma_playback = &spdif_stereo_out;
439 439
440 return 0; 440 ret = asoc_dma_platform_register(&pdev->dev);
441 if (ret) {
442 dev_err(&pdev->dev, "failed to register DMA: %d\n", ret);
443 goto err5;
444 }
441 445
446 return 0;
447err5:
448 snd_soc_unregister_dai(&pdev->dev);
442err4: 449err4:
443 iounmap(spdif->regs); 450 iounmap(spdif->regs);
444err3: 451err3:
445 release_mem_region(mem_res->start, resource_size(mem_res)); 452 release_mem_region(mem_res->start, resource_size(mem_res));
446err2: 453err2:
447 clk_disable(spdif->sclk); 454 clk_disable_unprepare(spdif->sclk);
448 clk_put(spdif->sclk); 455 clk_put(spdif->sclk);
449err1: 456err1:
450 clk_disable(spdif->pclk); 457 clk_disable_unprepare(spdif->pclk);
451 clk_put(spdif->pclk); 458 clk_put(spdif->pclk);
452err0: 459err0:
453 return ret; 460 return ret;
@@ -458,6 +465,7 @@ static __devexit int spdif_remove(struct platform_device *pdev)
458 struct samsung_spdif_info *spdif = &spdif_info; 465 struct samsung_spdif_info *spdif = &spdif_info;
459 struct resource *mem_res; 466 struct resource *mem_res;
460 467
468 asoc_dma_platform_unregister(&pdev->dev);
461 snd_soc_unregister_dai(&pdev->dev); 469 snd_soc_unregister_dai(&pdev->dev);
462 470
463 iounmap(spdif->regs); 471 iounmap(spdif->regs);
@@ -466,9 +474,9 @@ static __devexit int spdif_remove(struct platform_device *pdev)
466 if (mem_res) 474 if (mem_res)
467 release_mem_region(mem_res->start, resource_size(mem_res)); 475 release_mem_region(mem_res->start, resource_size(mem_res));
468 476
469 clk_disable(spdif->sclk); 477 clk_disable_unprepare(spdif->sclk);
470 clk_put(spdif->sclk); 478 clk_put(spdif->sclk);
471 clk_disable(spdif->pclk); 479 clk_disable_unprepare(spdif->pclk);
472 clk_put(spdif->pclk); 480 clk_put(spdif->pclk);
473 481
474 return 0; 482 return 0;
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c
index c7e1c28528a4..d7906a144195 100644
--- a/sound/soc/samsung/speyside.c
+++ b/sound/soc/samsung/speyside.c
@@ -198,7 +198,7 @@ static struct snd_soc_dai_link speyside_dai[] = {
198 .stream_name = "CPU-DSP", 198 .stream_name = "CPU-DSP",
199 .cpu_dai_name = "samsung-i2s.0", 199 .cpu_dai_name = "samsung-i2s.0",
200 .codec_dai_name = "wm0010-sdi1", 200 .codec_dai_name = "wm0010-sdi1",
201 .platform_name = "samsung-audio", 201 .platform_name = "samsung-i2s.0",
202 .codec_name = "spi0.0", 202 .codec_name = "spi0.0",
203 .init = speyside_wm0010_init, 203 .init = speyside_wm0010_init,
204 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF 204 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
diff --git a/sound/soc/samsung/tobermory.c b/sound/soc/samsung/tobermory.c
index 9199649bf786..42e4c8e6b03e 100644
--- a/sound/soc/samsung/tobermory.c
+++ b/sound/soc/samsung/tobermory.c
@@ -110,7 +110,7 @@ static struct snd_soc_dai_link tobermory_dai[] = {
110 .stream_name = "CPU", 110 .stream_name = "CPU",
111 .cpu_dai_name = "samsung-i2s.0", 111 .cpu_dai_name = "samsung-i2s.0",
112 .codec_dai_name = "wm8962", 112 .codec_dai_name = "wm8962",
113 .platform_name = "samsung-audio", 113 .platform_name = "samsung-i2s.0",
114 .codec_name = "wm8962.1-001a", 114 .codec_name = "wm8962.1-001a",
115 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF 115 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
116 | SND_SOC_DAIFMT_CBM_CFM, 116 | SND_SOC_DAIFMT_CBM_CFM,