diff options
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/Kconfig | 5 | ||||
-rw-r--r-- | sound/soc/samsung/ac97.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/goni_wm8994.c | 11 | ||||
-rw-r--r-- | sound/soc/samsung/h1940_uda1380.c | 2 | ||||
-rw-r--r-- | sound/soc/samsung/i2s.c | 16 | ||||
-rw-r--r-- | sound/soc/samsung/idma.c | 11 | ||||
-rw-r--r-- | sound/soc/samsung/neo1973_wm8753.c | 3 | ||||
-rw-r--r-- | sound/soc/samsung/pcm.c | 11 | ||||
-rw-r--r-- | sound/soc/samsung/regs-ac97.h | 67 | ||||
-rw-r--r-- | sound/soc/samsung/regs-iis.h | 70 | ||||
-rw-r--r-- | sound/soc/samsung/rx1950_uda1380.c | 2 | ||||
-rw-r--r-- | sound/soc/samsung/s3c-i2s-v2.c | 9 | ||||
-rw-r--r-- | sound/soc/samsung/s3c-i2s-v2.h | 7 | ||||
-rw-r--r-- | sound/soc/samsung/s3c2412-i2s.c | 12 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx-i2s.c | 13 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx_uda134x.c | 2 | ||||
-rw-r--r-- | sound/soc/samsung/spdif.c | 11 |
17 files changed, 223 insertions, 43 deletions
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 90e7e6653233..475fb0d8b3c6 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig | |||
@@ -35,11 +35,10 @@ config SND_SAMSUNG_I2S | |||
35 | tristate | 35 | tristate |
36 | 36 | ||
37 | config SND_SOC_SAMSUNG_NEO1973_WM8753 | 37 | config SND_SOC_SAMSUNG_NEO1973_WM8753 |
38 | tristate "Audio support for Openmoko Neo1973 Smartphones (GTA01/GTA02)" | 38 | tristate "Audio support for Openmoko Neo1973 Smartphones (GTA02)" |
39 | depends on SND_SOC_SAMSUNG && (MACH_NEO1973_GTA01 || MACH_NEO1973_GTA02) | 39 | depends on SND_SOC_SAMSUNG && MACH_NEO1973_GTA02 |
40 | select SND_S3C24XX_I2S | 40 | select SND_S3C24XX_I2S |
41 | select SND_SOC_WM8753 | 41 | select SND_SOC_WM8753 |
42 | select SND_SOC_LM4857 if MACH_NEO1973_GTA01 | ||
43 | select SND_SOC_DFBMCS320 | 42 | select SND_SOC_DFBMCS320 |
44 | help | 43 | help |
45 | Say Y here to enable audio support for the Openmoko Neo1973 | 44 | Say Y here to enable audio support for the Openmoko Neo1973 |
diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c index 0df3c5644cfa..cb88ead98917 100644 --- a/sound/soc/samsung/ac97.c +++ b/sound/soc/samsung/ac97.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <sound/soc.h> | 20 | #include <sound/soc.h> |
21 | 21 | ||
22 | #include <mach/dma.h> | 22 | #include <mach/dma.h> |
23 | #include <plat/regs-ac97.h> | 23 | #include "regs-ac97.h" |
24 | #include <linux/platform_data/asoc-s3c.h> | 24 | #include <linux/platform_data/asoc-s3c.h> |
25 | 25 | ||
26 | #include "dma.h" | 26 | #include "dma.h" |
@@ -370,6 +370,10 @@ static struct snd_soc_dai_driver s3c_ac97_dai[] = { | |||
370 | }, | 370 | }, |
371 | }; | 371 | }; |
372 | 372 | ||
373 | static const struct snd_soc_component_driver s3c_ac97_component = { | ||
374 | .name = "s3c-ac97", | ||
375 | }; | ||
376 | |||
373 | static int s3c_ac97_probe(struct platform_device *pdev) | 377 | static int s3c_ac97_probe(struct platform_device *pdev) |
374 | { | 378 | { |
375 | struct resource *mem_res, *dmatx_res, *dmarx_res, *dmamic_res, *irq_res; | 379 | struct resource *mem_res, *dmatx_res, *dmarx_res, *dmamic_res, *irq_res; |
@@ -457,8 +461,8 @@ static int s3c_ac97_probe(struct platform_device *pdev) | |||
457 | goto err4; | 461 | goto err4; |
458 | } | 462 | } |
459 | 463 | ||
460 | ret = snd_soc_register_dais(&pdev->dev, s3c_ac97_dai, | 464 | ret = snd_soc_register_component(&pdev->dev, &s3c_ac97_component, |
461 | ARRAY_SIZE(s3c_ac97_dai)); | 465 | s3c_ac97_dai, ARRAY_SIZE(s3c_ac97_dai)); |
462 | if (ret) | 466 | if (ret) |
463 | goto err5; | 467 | goto err5; |
464 | 468 | ||
@@ -470,7 +474,7 @@ static int s3c_ac97_probe(struct platform_device *pdev) | |||
470 | 474 | ||
471 | return 0; | 475 | return 0; |
472 | err6: | 476 | err6: |
473 | snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai)); | 477 | snd_soc_unregister_component(&pdev->dev); |
474 | err5: | 478 | err5: |
475 | free_irq(irq_res->start, NULL); | 479 | free_irq(irq_res->start, NULL); |
476 | err4: | 480 | err4: |
@@ -490,7 +494,7 @@ static int s3c_ac97_remove(struct platform_device *pdev) | |||
490 | struct resource *mem_res, *irq_res; | 494 | struct resource *mem_res, *irq_res; |
491 | 495 | ||
492 | asoc_dma_platform_unregister(&pdev->dev); | 496 | asoc_dma_platform_unregister(&pdev->dev); |
493 | snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(s3c_ac97_dai)); | 497 | snd_soc_unregister_component(&pdev->dev); |
494 | 498 | ||
495 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 499 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
496 | if (irq_res) | 500 | if (irq_res) |
diff --git a/sound/soc/samsung/goni_wm8994.c b/sound/soc/samsung/goni_wm8994.c index d37ede58e0a8..415ad81999c4 100644 --- a/sound/soc/samsung/goni_wm8994.c +++ b/sound/soc/samsung/goni_wm8994.c | |||
@@ -218,6 +218,10 @@ static struct snd_soc_dai_driver voice_dai = { | |||
218 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 218 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
219 | }; | 219 | }; |
220 | 220 | ||
221 | static const struct snd_soc_component_driver voice_component = { | ||
222 | .name = "goni-voice", | ||
223 | }; | ||
224 | |||
221 | static struct snd_soc_ops goni_voice_ops = { | 225 | static struct snd_soc_ops goni_voice_ops = { |
222 | .hw_params = goni_voice_hw_params, | 226 | .hw_params = goni_voice_hw_params, |
223 | }; | 227 | }; |
@@ -270,7 +274,8 @@ static int __init goni_init(void) | |||
270 | return -ENOMEM; | 274 | return -ENOMEM; |
271 | 275 | ||
272 | /* register voice DAI here */ | 276 | /* register voice DAI here */ |
273 | ret = snd_soc_register_dai(&goni_snd_device->dev, &voice_dai); | 277 | ret = snd_soc_register_component(&goni_snd_device->dev, &voice_component, |
278 | &voice_dai, 1); | ||
274 | if (ret) { | 279 | if (ret) { |
275 | platform_device_put(goni_snd_device); | 280 | platform_device_put(goni_snd_device); |
276 | return ret; | 281 | return ret; |
@@ -280,7 +285,7 @@ static int __init goni_init(void) | |||
280 | ret = platform_device_add(goni_snd_device); | 285 | ret = platform_device_add(goni_snd_device); |
281 | 286 | ||
282 | if (ret) { | 287 | if (ret) { |
283 | snd_soc_unregister_dai(&goni_snd_device->dev); | 288 | snd_soc_unregister_component(&goni_snd_device->dev); |
284 | platform_device_put(goni_snd_device); | 289 | platform_device_put(goni_snd_device); |
285 | } | 290 | } |
286 | 291 | ||
@@ -289,7 +294,7 @@ static int __init goni_init(void) | |||
289 | 294 | ||
290 | static void __exit goni_exit(void) | 295 | static void __exit goni_exit(void) |
291 | { | 296 | { |
292 | snd_soc_unregister_dai(&goni_snd_device->dev); | 297 | snd_soc_unregister_component(&goni_snd_device->dev); |
293 | platform_device_unregister(goni_snd_device); | 298 | platform_device_unregister(goni_snd_device); |
294 | } | 299 | } |
295 | 300 | ||
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index 15a3817aa5c8..fa91376e323d 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <sound/soc.h> | 20 | #include <sound/soc.h> |
21 | #include <sound/jack.h> | 21 | #include <sound/jack.h> |
22 | 22 | ||
23 | #include <plat/regs-iis.h> | 23 | #include "regs-iis.h" |
24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
25 | 25 | ||
26 | #include "s3c24xx-i2s.h" | 26 | #include "s3c24xx-i2s.h" |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 6bbeb0bf1a73..82ebb1a51479 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -963,6 +963,10 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { | |||
963 | .delay = i2s_delay, | 963 | .delay = i2s_delay, |
964 | }; | 964 | }; |
965 | 965 | ||
966 | static const struct snd_soc_component_driver samsung_i2s_component = { | ||
967 | .name = "samsung-i2s", | ||
968 | }; | ||
969 | |||
966 | #define SAMSUNG_I2S_RATES SNDRV_PCM_RATE_8000_96000 | 970 | #define SAMSUNG_I2S_RATES SNDRV_PCM_RATE_8000_96000 |
967 | 971 | ||
968 | #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ | 972 | #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ |
@@ -1114,8 +1118,9 @@ static int samsung_i2s_probe(struct platform_device *pdev) | |||
1114 | dev_err(&pdev->dev, "Unable to get drvdata\n"); | 1118 | dev_err(&pdev->dev, "Unable to get drvdata\n"); |
1115 | return -EFAULT; | 1119 | return -EFAULT; |
1116 | } | 1120 | } |
1117 | snd_soc_register_dai(&sec_dai->pdev->dev, | 1121 | snd_soc_register_component(&sec_dai->pdev->dev, |
1118 | &sec_dai->i2s_dai_drv); | 1122 | &samsung_i2s_component, |
1123 | &sec_dai->i2s_dai_drv, 1); | ||
1119 | asoc_dma_platform_register(&pdev->dev); | 1124 | asoc_dma_platform_register(&pdev->dev); |
1120 | return 0; | 1125 | return 0; |
1121 | } | 1126 | } |
@@ -1244,7 +1249,8 @@ static int samsung_i2s_probe(struct platform_device *pdev) | |||
1244 | } | 1249 | } |
1245 | } | 1250 | } |
1246 | 1251 | ||
1247 | snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv); | 1252 | snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component, |
1253 | &pri_dai->i2s_dai_drv, 1); | ||
1248 | 1254 | ||
1249 | pm_runtime_enable(&pdev->dev); | 1255 | pm_runtime_enable(&pdev->dev); |
1250 | 1256 | ||
@@ -1283,7 +1289,7 @@ static int samsung_i2s_remove(struct platform_device *pdev) | |||
1283 | i2s->sec_dai = NULL; | 1289 | i2s->sec_dai = NULL; |
1284 | 1290 | ||
1285 | asoc_dma_platform_unregister(&pdev->dev); | 1291 | asoc_dma_platform_unregister(&pdev->dev); |
1286 | snd_soc_unregister_dai(&pdev->dev); | 1292 | snd_soc_unregister_component(&pdev->dev); |
1287 | 1293 | ||
1288 | return 0; | 1294 | return 0; |
1289 | } | 1295 | } |
@@ -1298,7 +1304,7 @@ static struct platform_device_id samsung_i2s_driver_ids[] = { | |||
1298 | }, | 1304 | }, |
1299 | {}, | 1305 | {}, |
1300 | }; | 1306 | }; |
1301 | MODULE_DEVICE_TABLE(platform, samsung-i2s-driver-ids); | 1307 | MODULE_DEVICE_TABLE(platform, samsung_i2s_driver_ids); |
1302 | 1308 | ||
1303 | #ifdef CONFIG_OF | 1309 | #ifdef CONFIG_OF |
1304 | static struct samsung_i2s_dai_data samsung_i2s_dai_data_array[] = { | 1310 | static struct samsung_i2s_dai_data samsung_i2s_dai_data_array[] = { |
diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index a07950b0c8ce..6e5fed30aa27 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c | |||
@@ -68,6 +68,8 @@ static struct idma_info { | |||
68 | dma_addr_t lp_tx_addr; | 68 | dma_addr_t lp_tx_addr; |
69 | } idma; | 69 | } idma; |
70 | 70 | ||
71 | static int idma_irq; | ||
72 | |||
71 | static void idma_getpos(dma_addr_t *src) | 73 | static void idma_getpos(dma_addr_t *src) |
72 | { | 74 | { |
73 | *src = idma.lp_tx_addr + | 75 | *src = idma.lp_tx_addr + |
@@ -305,7 +307,7 @@ static int idma_open(struct snd_pcm_substream *substream) | |||
305 | if (prtd == NULL) | 307 | if (prtd == NULL) |
306 | return -ENOMEM; | 308 | return -ENOMEM; |
307 | 309 | ||
308 | ret = request_irq(IRQ_I2S0, iis_irq, 0, "i2s", prtd); | 310 | ret = request_irq(idma_irq, iis_irq, 0, "i2s", prtd); |
309 | if (ret < 0) { | 311 | if (ret < 0) { |
310 | pr_err("fail to claim i2s irq , ret = %d\n", ret); | 312 | pr_err("fail to claim i2s irq , ret = %d\n", ret); |
311 | kfree(prtd); | 313 | kfree(prtd); |
@@ -324,7 +326,7 @@ static int idma_close(struct snd_pcm_substream *substream) | |||
324 | struct snd_pcm_runtime *runtime = substream->runtime; | 326 | struct snd_pcm_runtime *runtime = substream->runtime; |
325 | struct idma_ctrl *prtd = runtime->private_data; | 327 | struct idma_ctrl *prtd = runtime->private_data; |
326 | 328 | ||
327 | free_irq(IRQ_I2S0, prtd); | 329 | free_irq(idma_irq, prtd); |
328 | 330 | ||
329 | if (!prtd) | 331 | if (!prtd) |
330 | pr_err("idma_close called with prtd == NULL\n"); | 332 | pr_err("idma_close called with prtd == NULL\n"); |
@@ -409,6 +411,7 @@ void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr) | |||
409 | idma.regs = regs; | 411 | idma.regs = regs; |
410 | idma.lp_tx_addr = addr; | 412 | idma.lp_tx_addr = addr; |
411 | } | 413 | } |
414 | EXPORT_SYMBOL_GPL(idma_reg_addr_init); | ||
412 | 415 | ||
413 | static struct snd_soc_platform_driver asoc_idma_platform = { | 416 | static struct snd_soc_platform_driver asoc_idma_platform = { |
414 | .ops = &idma_ops, | 417 | .ops = &idma_ops, |
@@ -418,6 +421,10 @@ static struct snd_soc_platform_driver asoc_idma_platform = { | |||
418 | 421 | ||
419 | static int asoc_idma_platform_probe(struct platform_device *pdev) | 422 | static int asoc_idma_platform_probe(struct platform_device *pdev) |
420 | { | 423 | { |
424 | idma_irq = platform_get_irq(pdev, 0); | ||
425 | if (idma_irq < 0) | ||
426 | return idma_irq; | ||
427 | |||
421 | return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform); | 428 | return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform); |
422 | } | 429 | } |
423 | 430 | ||
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index a301d8cfaa34..e591c386917a 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #include <sound/soc.h> | 21 | #include <sound/soc.h> |
22 | 22 | ||
23 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
24 | #include <plat/regs-iis.h> | 24 | #include "regs-iis.h" |
25 | #include <mach/gta02.h> | ||
26 | 25 | ||
27 | #include "../codecs/wm8753.h" | 26 | #include "../codecs/wm8753.h" |
28 | #include "s3c24xx-i2s.h" | 27 | #include "s3c24xx-i2s.h" |
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 13bab79ad93d..1566afe9ef52 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c | |||
@@ -490,6 +490,10 @@ static struct snd_soc_dai_driver s3c_pcm_dai[] = { | |||
490 | }, | 490 | }, |
491 | }; | 491 | }; |
492 | 492 | ||
493 | static const struct snd_soc_component_driver s3c_pcm_component = { | ||
494 | .name = "s3c-pcm", | ||
495 | }; | ||
496 | |||
493 | static int s3c_pcm_dev_probe(struct platform_device *pdev) | 497 | static int s3c_pcm_dev_probe(struct platform_device *pdev) |
494 | { | 498 | { |
495 | struct s3c_pcm_info *pcm; | 499 | struct s3c_pcm_info *pcm; |
@@ -583,7 +587,8 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) | |||
583 | 587 | ||
584 | pm_runtime_enable(&pdev->dev); | 588 | pm_runtime_enable(&pdev->dev); |
585 | 589 | ||
586 | ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]); | 590 | ret = snd_soc_register_component(&pdev->dev, &s3c_pcm_component, |
591 | &s3c_pcm_dai[pdev->id], 1); | ||
587 | if (ret != 0) { | 592 | if (ret != 0) { |
588 | dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret); | 593 | dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret); |
589 | goto err5; | 594 | goto err5; |
@@ -598,7 +603,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) | |||
598 | return 0; | 603 | return 0; |
599 | 604 | ||
600 | err6: | 605 | err6: |
601 | snd_soc_unregister_dai(&pdev->dev); | 606 | snd_soc_unregister_component(&pdev->dev); |
602 | err5: | 607 | err5: |
603 | clk_disable_unprepare(pcm->pclk); | 608 | clk_disable_unprepare(pcm->pclk); |
604 | clk_put(pcm->pclk); | 609 | clk_put(pcm->pclk); |
@@ -619,7 +624,7 @@ static int s3c_pcm_dev_remove(struct platform_device *pdev) | |||
619 | struct resource *mem_res; | 624 | struct resource *mem_res; |
620 | 625 | ||
621 | asoc_dma_platform_unregister(&pdev->dev); | 626 | asoc_dma_platform_unregister(&pdev->dev); |
622 | snd_soc_unregister_dai(&pdev->dev); | 627 | snd_soc_unregister_component(&pdev->dev); |
623 | 628 | ||
624 | pm_runtime_disable(&pdev->dev); | 629 | pm_runtime_disable(&pdev->dev); |
625 | 630 | ||
diff --git a/sound/soc/samsung/regs-ac97.h b/sound/soc/samsung/regs-ac97.h new file mode 100644 index 000000000000..c3878f7acb83 --- /dev/null +++ b/sound/soc/samsung/regs-ac97.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/regs-ac97.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics <linux@simtec.co.uk> | ||
4 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * S3C2440 AC97 Controller | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_REGS_AC97_H | ||
14 | #define __ASM_ARCH_REGS_AC97_H __FILE__ | ||
15 | |||
16 | #define S3C_AC97_GLBCTRL (0x00) | ||
17 | |||
18 | #define S3C_AC97_GLBCTRL_CODECREADYIE (1<<22) | ||
19 | #define S3C_AC97_GLBCTRL_PCMOUTURIE (1<<21) | ||
20 | #define S3C_AC97_GLBCTRL_PCMINORIE (1<<20) | ||
21 | #define S3C_AC97_GLBCTRL_MICINORIE (1<<19) | ||
22 | #define S3C_AC97_GLBCTRL_PCMOUTTIE (1<<18) | ||
23 | #define S3C_AC97_GLBCTRL_PCMINTIE (1<<17) | ||
24 | #define S3C_AC97_GLBCTRL_MICINTIE (1<<16) | ||
25 | #define S3C_AC97_GLBCTRL_PCMOUTTM_OFF (0<<12) | ||
26 | #define S3C_AC97_GLBCTRL_PCMOUTTM_PIO (1<<12) | ||
27 | #define S3C_AC97_GLBCTRL_PCMOUTTM_DMA (2<<12) | ||
28 | #define S3C_AC97_GLBCTRL_PCMOUTTM_MASK (3<<12) | ||
29 | #define S3C_AC97_GLBCTRL_PCMINTM_OFF (0<<10) | ||
30 | #define S3C_AC97_GLBCTRL_PCMINTM_PIO (1<<10) | ||
31 | #define S3C_AC97_GLBCTRL_PCMINTM_DMA (2<<10) | ||
32 | #define S3C_AC97_GLBCTRL_PCMINTM_MASK (3<<10) | ||
33 | #define S3C_AC97_GLBCTRL_MICINTM_OFF (0<<8) | ||
34 | #define S3C_AC97_GLBCTRL_MICINTM_PIO (1<<8) | ||
35 | #define S3C_AC97_GLBCTRL_MICINTM_DMA (2<<8) | ||
36 | #define S3C_AC97_GLBCTRL_MICINTM_MASK (3<<8) | ||
37 | #define S3C_AC97_GLBCTRL_TRANSFERDATAENABLE (1<<3) | ||
38 | #define S3C_AC97_GLBCTRL_ACLINKON (1<<2) | ||
39 | #define S3C_AC97_GLBCTRL_WARMRESET (1<<1) | ||
40 | #define S3C_AC97_GLBCTRL_COLDRESET (1<<0) | ||
41 | |||
42 | #define S3C_AC97_GLBSTAT (0x04) | ||
43 | |||
44 | #define S3C_AC97_GLBSTAT_CODECREADY (1<<22) | ||
45 | #define S3C_AC97_GLBSTAT_PCMOUTUR (1<<21) | ||
46 | #define S3C_AC97_GLBSTAT_PCMINORI (1<<20) | ||
47 | #define S3C_AC97_GLBSTAT_MICINORI (1<<19) | ||
48 | #define S3C_AC97_GLBSTAT_PCMOUTTI (1<<18) | ||
49 | #define S3C_AC97_GLBSTAT_PCMINTI (1<<17) | ||
50 | #define S3C_AC97_GLBSTAT_MICINTI (1<<16) | ||
51 | #define S3C_AC97_GLBSTAT_MAINSTATE_IDLE (0<<0) | ||
52 | #define S3C_AC97_GLBSTAT_MAINSTATE_INIT (1<<0) | ||
53 | #define S3C_AC97_GLBSTAT_MAINSTATE_READY (2<<0) | ||
54 | #define S3C_AC97_GLBSTAT_MAINSTATE_ACTIVE (3<<0) | ||
55 | #define S3C_AC97_GLBSTAT_MAINSTATE_LP (4<<0) | ||
56 | #define S3C_AC97_GLBSTAT_MAINSTATE_WARM (5<<0) | ||
57 | |||
58 | #define S3C_AC97_CODEC_CMD (0x08) | ||
59 | |||
60 | #define S3C_AC97_CODEC_CMD_READ (1<<23) | ||
61 | |||
62 | #define S3C_AC97_STAT (0x0c) | ||
63 | #define S3C_AC97_PCM_ADDR (0x10) | ||
64 | #define S3C_AC97_PCM_DATA (0x18) | ||
65 | #define S3C_AC97_MIC_DATA (0x1C) | ||
66 | |||
67 | #endif /* __ASM_ARCH_REGS_AC97_H */ | ||
diff --git a/sound/soc/samsung/regs-iis.h b/sound/soc/samsung/regs-iis.h new file mode 100644 index 000000000000..a18d35e7a735 --- /dev/null +++ b/sound/soc/samsung/regs-iis.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/regs-iis.h | ||
2 | * | ||
3 | * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> | ||
4 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * S3C2410 IIS register definition | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_REGS_IIS_H | ||
14 | #define __ASM_ARCH_REGS_IIS_H | ||
15 | |||
16 | #define S3C2410_IISCON (0x00) | ||
17 | |||
18 | #define S3C2410_IISCON_LRINDEX (1 << 8) | ||
19 | #define S3C2410_IISCON_TXFIFORDY (1 << 7) | ||
20 | #define S3C2410_IISCON_RXFIFORDY (1 << 6) | ||
21 | #define S3C2410_IISCON_TXDMAEN (1 << 5) | ||
22 | #define S3C2410_IISCON_RXDMAEN (1 << 4) | ||
23 | #define S3C2410_IISCON_TXIDLE (1 << 3) | ||
24 | #define S3C2410_IISCON_RXIDLE (1 << 2) | ||
25 | #define S3C2410_IISCON_PSCEN (1 << 1) | ||
26 | #define S3C2410_IISCON_IISEN (1 << 0) | ||
27 | |||
28 | #define S3C2410_IISMOD (0x04) | ||
29 | |||
30 | #define S3C2440_IISMOD_MPLL (1 << 9) | ||
31 | #define S3C2410_IISMOD_SLAVE (1 << 8) | ||
32 | #define S3C2410_IISMOD_NOXFER (0 << 6) | ||
33 | #define S3C2410_IISMOD_RXMODE (1 << 6) | ||
34 | #define S3C2410_IISMOD_TXMODE (2 << 6) | ||
35 | #define S3C2410_IISMOD_TXRXMODE (3 << 6) | ||
36 | #define S3C2410_IISMOD_LR_LLOW (0 << 5) | ||
37 | #define S3C2410_IISMOD_LR_RLOW (1 << 5) | ||
38 | #define S3C2410_IISMOD_IIS (0 << 4) | ||
39 | #define S3C2410_IISMOD_MSB (1 << 4) | ||
40 | #define S3C2410_IISMOD_8BIT (0 << 3) | ||
41 | #define S3C2410_IISMOD_16BIT (1 << 3) | ||
42 | #define S3C2410_IISMOD_BITMASK (1 << 3) | ||
43 | #define S3C2410_IISMOD_256FS (0 << 2) | ||
44 | #define S3C2410_IISMOD_384FS (1 << 2) | ||
45 | #define S3C2410_IISMOD_16FS (0 << 0) | ||
46 | #define S3C2410_IISMOD_32FS (1 << 0) | ||
47 | #define S3C2410_IISMOD_48FS (2 << 0) | ||
48 | #define S3C2410_IISMOD_FS_MASK (3 << 0) | ||
49 | |||
50 | #define S3C2410_IISPSR (0x08) | ||
51 | |||
52 | #define S3C2410_IISPSR_INTMASK (31 << 5) | ||
53 | #define S3C2410_IISPSR_INTSHIFT (5) | ||
54 | #define S3C2410_IISPSR_EXTMASK (31 << 0) | ||
55 | #define S3C2410_IISPSR_EXTSHFIT (0) | ||
56 | |||
57 | #define S3C2410_IISFCON (0x0c) | ||
58 | |||
59 | #define S3C2410_IISFCON_TXDMA (1 << 15) | ||
60 | #define S3C2410_IISFCON_RXDMA (1 << 14) | ||
61 | #define S3C2410_IISFCON_TXENABLE (1 << 13) | ||
62 | #define S3C2410_IISFCON_RXENABLE (1 << 12) | ||
63 | #define S3C2410_IISFCON_TXMASK (0x3f << 6) | ||
64 | #define S3C2410_IISFCON_TXSHIFT (6) | ||
65 | #define S3C2410_IISFCON_RXMASK (0x3f) | ||
66 | #define S3C2410_IISFCON_RXSHIFT (0) | ||
67 | |||
68 | #define S3C2410_IISFIFO (0x10) | ||
69 | |||
70 | #endif /* __ASM_ARCH_REGS_IIS_H */ | ||
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index a5826ea9cad6..704460a37005 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <sound/soc.h> | 24 | #include <sound/soc.h> |
25 | #include <sound/jack.h> | 25 | #include <sound/jack.h> |
26 | 26 | ||
27 | #include <plat/regs-iis.h> | 27 | #include "regs-iis.h" |
28 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
29 | 29 | ||
30 | #include "s3c24xx-i2s.h" | 30 | #include "s3c24xx-i2s.h" |
diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c index 7a73380b3560..20e98d1dded2 100644 --- a/sound/soc/samsung/s3c-i2s-v2.c +++ b/sound/soc/samsung/s3c-i2s-v2.c | |||
@@ -731,8 +731,9 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai) | |||
731 | #define s3c2412_i2s_resume NULL | 731 | #define s3c2412_i2s_resume NULL |
732 | #endif | 732 | #endif |
733 | 733 | ||
734 | int s3c_i2sv2_register_dai(struct device *dev, int id, | 734 | int s3c_i2sv2_register_component(struct device *dev, int id, |
735 | struct snd_soc_dai_driver *drv) | 735 | struct snd_soc_component_driver *cmp_drv, |
736 | struct snd_soc_dai_driver *dai_drv) | ||
736 | { | 737 | { |
737 | struct snd_soc_dai_ops *ops = drv->ops; | 738 | struct snd_soc_dai_ops *ops = drv->ops; |
738 | 739 | ||
@@ -750,8 +751,8 @@ int s3c_i2sv2_register_dai(struct device *dev, int id, | |||
750 | drv->suspend = s3c2412_i2s_suspend; | 751 | drv->suspend = s3c2412_i2s_suspend; |
751 | drv->resume = s3c2412_i2s_resume; | 752 | drv->resume = s3c2412_i2s_resume; |
752 | 753 | ||
753 | return snd_soc_register_dai(dev, drv); | 754 | return snd_soc_register_component(dev, cmp_drv, dai_drv, 1); |
754 | } | 755 | } |
755 | EXPORT_SYMBOL_GPL(s3c_i2sv2_register_dai); | 756 | EXPORT_SYMBOL_GPL(s3c_i2sv2_register_component); |
756 | 757 | ||
757 | MODULE_LICENSE("GPL"); | 758 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/samsung/s3c-i2s-v2.h b/sound/soc/samsung/s3c-i2s-v2.h index f8297d9bb8a3..90abab364b49 100644 --- a/sound/soc/samsung/s3c-i2s-v2.h +++ b/sound/soc/samsung/s3c-i2s-v2.h | |||
@@ -92,7 +92,7 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai, | |||
92 | unsigned long base); | 92 | unsigned long base); |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * s3c_i2sv2_register_dai - register dai with soc core | 95 | * s3c_i2sv2_register_component - register component and dai with soc core |
96 | * @dev: DAI device | 96 | * @dev: DAI device |
97 | * @id: DAI ID | 97 | * @id: DAI ID |
98 | * @drv: The driver structure to register | 98 | * @drv: The driver structure to register |
@@ -100,7 +100,8 @@ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai, | |||
100 | * Fill in any missing fields and then register the given dai with the | 100 | * Fill in any missing fields and then register the given dai with the |
101 | * soc core. | 101 | * soc core. |
102 | */ | 102 | */ |
103 | extern int s3c_i2sv2_register_dai(struct device *dev, int id, | 103 | extern int s3c_i2sv2_register_component(struct device *dev, int id, |
104 | struct snd_soc_dai_driver *drv); | 104 | struct snd_soc_component_driver *cmp_drv, |
105 | struct snd_soc_dai_driver *dai_drv); | ||
105 | 106 | ||
106 | #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */ | 107 | #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */ |
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 221337716393..47e23864ea72 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c | |||
@@ -160,11 +160,17 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = { | |||
160 | .ops = &s3c2412_i2s_dai_ops, | 160 | .ops = &s3c2412_i2s_dai_ops, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | static const struct snd_soc_component_driver s3c2412_i2s_component = { | ||
164 | .name = "s3c2412-i2s", | ||
165 | }; | ||
166 | |||
163 | static int s3c2412_iis_dev_probe(struct platform_device *pdev) | 167 | static int s3c2412_iis_dev_probe(struct platform_device *pdev) |
164 | { | 168 | { |
165 | int ret = 0; | 169 | int ret = 0; |
166 | 170 | ||
167 | ret = s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai); | 171 | ret = s3c_i2sv2_register_component(&pdev->dev, -1, |
172 | &s3c2412_i2s_component, | ||
173 | &s3c2412_i2s_dai); | ||
168 | if (ret) { | 174 | if (ret) { |
169 | pr_err("failed to register the dai\n"); | 175 | pr_err("failed to register the dai\n"); |
170 | return ret; | 176 | return ret; |
@@ -178,14 +184,14 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev) | |||
178 | 184 | ||
179 | return 0; | 185 | return 0; |
180 | err: | 186 | err: |
181 | snd_soc_unregister_dai(&pdev->dev); | 187 | snd_soc_unregister_component(&pdev->dev); |
182 | return ret; | 188 | return ret; |
183 | } | 189 | } |
184 | 190 | ||
185 | static int s3c2412_iis_dev_remove(struct platform_device *pdev) | 191 | static int s3c2412_iis_dev_remove(struct platform_device *pdev) |
186 | { | 192 | { |
187 | asoc_dma_platform_unregister(&pdev->dev); | 193 | asoc_dma_platform_unregister(&pdev->dev); |
188 | snd_soc_unregister_dai(&pdev->dev); | 194 | snd_soc_unregister_component(&pdev->dev); |
189 | return 0; | 195 | return 0; |
190 | } | 196 | } |
191 | 197 | ||
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 13f6dd1ceb00..8b3414551a62 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <sound/pcm_params.h> | 24 | #include <sound/pcm_params.h> |
25 | 25 | ||
26 | #include <mach/dma.h> | 26 | #include <mach/dma.h> |
27 | #include <plat/regs-iis.h> | 27 | #include "regs-iis.h" |
28 | 28 | ||
29 | #include "dma.h" | 29 | #include "dma.h" |
30 | #include "s3c24xx-i2s.h" | 30 | #include "s3c24xx-i2s.h" |
@@ -465,11 +465,16 @@ static struct snd_soc_dai_driver s3c24xx_i2s_dai = { | |||
465 | .ops = &s3c24xx_i2s_dai_ops, | 465 | .ops = &s3c24xx_i2s_dai_ops, |
466 | }; | 466 | }; |
467 | 467 | ||
468 | static const struct snd_soc_component_driver s3c24xx_i2s_component = { | ||
469 | .name = "s3c24xx-i2s", | ||
470 | }; | ||
471 | |||
468 | static int s3c24xx_iis_dev_probe(struct platform_device *pdev) | 472 | static int s3c24xx_iis_dev_probe(struct platform_device *pdev) |
469 | { | 473 | { |
470 | int ret = 0; | 474 | int ret = 0; |
471 | 475 | ||
472 | ret = snd_soc_register_dai(&pdev->dev, &s3c24xx_i2s_dai); | 476 | ret = snd_soc_register_component(&pdev->dev, &s3c24xx_i2s_component, |
477 | &s3c24xx_i2s_dai, 1); | ||
473 | if (ret) { | 478 | if (ret) { |
474 | pr_err("failed to register the dai\n"); | 479 | pr_err("failed to register the dai\n"); |
475 | return ret; | 480 | return ret; |
@@ -483,14 +488,14 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev) | |||
483 | 488 | ||
484 | return 0; | 489 | return 0; |
485 | err: | 490 | err: |
486 | snd_soc_unregister_dai(&pdev->dev); | 491 | snd_soc_unregister_component(&pdev->dev); |
487 | return ret; | 492 | return ret; |
488 | } | 493 | } |
489 | 494 | ||
490 | static int s3c24xx_iis_dev_remove(struct platform_device *pdev) | 495 | static int s3c24xx_iis_dev_remove(struct platform_device *pdev) |
491 | { | 496 | { |
492 | asoc_dma_platform_unregister(&pdev->dev); | 497 | asoc_dma_platform_unregister(&pdev->dev); |
493 | snd_soc_unregister_dai(&pdev->dev); | 498 | snd_soc_unregister_component(&pdev->dev); |
494 | return 0; | 499 | return 0; |
495 | } | 500 | } |
496 | 501 | ||
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c index 333e1b7f06c7..1b7b52b0af97 100644 --- a/sound/soc/samsung/s3c24xx_uda134x.c +++ b/sound/soc/samsung/s3c24xx_uda134x.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <sound/soc.h> | 18 | #include <sound/soc.h> |
19 | #include <sound/s3c24xx_uda134x.h> | 19 | #include <sound/s3c24xx_uda134x.h> |
20 | 20 | ||
21 | #include <plat/regs-iis.h> | 21 | #include "regs-iis.h" |
22 | 22 | ||
23 | #include "s3c24xx-i2s.h" | 23 | #include "s3c24xx-i2s.h" |
24 | 24 | ||
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index 5008e5bd6ed8..2e5ebb2f1982 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c | |||
@@ -357,6 +357,10 @@ static struct snd_soc_dai_driver samsung_spdif_dai = { | |||
357 | .resume = spdif_resume, | 357 | .resume = spdif_resume, |
358 | }; | 358 | }; |
359 | 359 | ||
360 | static const struct snd_soc_component_driver samsung_spdif_component = { | ||
361 | .name = "samsung-spdif", | ||
362 | }; | ||
363 | |||
360 | static int spdif_probe(struct platform_device *pdev) | 364 | static int spdif_probe(struct platform_device *pdev) |
361 | { | 365 | { |
362 | struct s3c_audio_pdata *spdif_pdata; | 366 | struct s3c_audio_pdata *spdif_pdata; |
@@ -424,7 +428,8 @@ static int spdif_probe(struct platform_device *pdev) | |||
424 | 428 | ||
425 | dev_set_drvdata(&pdev->dev, spdif); | 429 | dev_set_drvdata(&pdev->dev, spdif); |
426 | 430 | ||
427 | ret = snd_soc_register_dai(&pdev->dev, &samsung_spdif_dai); | 431 | ret = snd_soc_register_component(&pdev->dev, &samsung_spdif_component, |
432 | &samsung_spdif_dai, 1); | ||
428 | if (ret != 0) { | 433 | if (ret != 0) { |
429 | dev_err(&pdev->dev, "fail to register dai\n"); | 434 | dev_err(&pdev->dev, "fail to register dai\n"); |
430 | goto err4; | 435 | goto err4; |
@@ -445,7 +450,7 @@ static int spdif_probe(struct platform_device *pdev) | |||
445 | 450 | ||
446 | return 0; | 451 | return 0; |
447 | err5: | 452 | err5: |
448 | snd_soc_unregister_dai(&pdev->dev); | 453 | snd_soc_unregister_component(&pdev->dev); |
449 | err4: | 454 | err4: |
450 | iounmap(spdif->regs); | 455 | iounmap(spdif->regs); |
451 | err3: | 456 | err3: |
@@ -466,7 +471,7 @@ static int spdif_remove(struct platform_device *pdev) | |||
466 | struct resource *mem_res; | 471 | struct resource *mem_res; |
467 | 472 | ||
468 | asoc_dma_platform_unregister(&pdev->dev); | 473 | asoc_dma_platform_unregister(&pdev->dev); |
469 | snd_soc_unregister_dai(&pdev->dev); | 474 | snd_soc_unregister_component(&pdev->dev); |
470 | 475 | ||
471 | iounmap(spdif->regs); | 476 | iounmap(spdif->regs); |
472 | 477 | ||