diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-08-04 15:27:03 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-05 13:06:30 -0400 |
commit | 64ddf1f89cd7a483e1204320395023774234b49a (patch) | |
tree | 067139342472af7201368f0f758cb65f4fd741db | |
parent | db43b16fa0e913582b63c971848e08151d50d952 (diff) |
ASoC: kirkwood: combine kirkwood-i2s and kirkwood-dma drivers
These really should be a single driver because they're fully integrated
in hardware. Make them so.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | arch/arm/mach-dove/common.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 24 | ||||
-rw-r--r-- | sound/soc/kirkwood/Kconfig | 5 | ||||
-rw-r--r-- | sound/soc/kirkwood/Makefile | 4 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood-dma.c | 30 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood-i2s.c | 21 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood-openrd.c | 4 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood-t5325.c | 4 | ||||
-rw-r--r-- | sound/soc/kirkwood/kirkwood.h | 2 |
9 files changed, 35 insertions, 63 deletions
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 00247c771313..304f069ebf50 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -108,8 +108,8 @@ static void __init dove_clk_init(void) | |||
108 | orion_clkdev_add(NULL, "sdhci-dove.1", sdio1); | 108 | orion_clkdev_add(NULL, "sdhci-dove.1", sdio1); |
109 | orion_clkdev_add(NULL, "orion_nand", nand); | 109 | orion_clkdev_add(NULL, "orion_nand", nand); |
110 | orion_clkdev_add(NULL, "cafe1000-ccic.0", camera); | 110 | orion_clkdev_add(NULL, "cafe1000-ccic.0", camera); |
111 | orion_clkdev_add(NULL, "kirkwood-i2s.0", i2s0); | 111 | orion_clkdev_add(NULL, "mvebu-audio.0", i2s0); |
112 | orion_clkdev_add(NULL, "kirkwood-i2s.1", i2s1); | 112 | orion_clkdev_add(NULL, "mvebu-audio.1", i2s1); |
113 | orion_clkdev_add(NULL, "mv_crypto", crypto); | 113 | orion_clkdev_add(NULL, "mv_crypto", crypto); |
114 | orion_clkdev_add(NULL, "dove-ac97", ac97); | 114 | orion_clkdev_add(NULL, "dove-ac97", ac97); |
115 | orion_clkdev_add(NULL, "dove-pdma", pdma); | 115 | orion_clkdev_add(NULL, "dove-pdma", pdma); |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index e9238b5567ee..1663de090984 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -264,7 +264,7 @@ void __init kirkwood_clk_init(void) | |||
264 | orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1); | 264 | orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1); |
265 | orion_clkdev_add("0", "pcie", pex0); | 265 | orion_clkdev_add("0", "pcie", pex0); |
266 | orion_clkdev_add("1", "pcie", pex1); | 266 | orion_clkdev_add("1", "pcie", pex1); |
267 | orion_clkdev_add(NULL, "kirkwood-i2s", audio); | 267 | orion_clkdev_add(NULL, "mvebu-audio", audio); |
268 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); | 268 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); |
269 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit); | 269 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit); |
270 | 270 | ||
@@ -560,7 +560,7 @@ void __init kirkwood_timer_init(void) | |||
560 | /***************************************************************************** | 560 | /***************************************************************************** |
561 | * Audio | 561 | * Audio |
562 | ****************************************************************************/ | 562 | ****************************************************************************/ |
563 | static struct resource kirkwood_i2s_resources[] = { | 563 | static struct resource kirkwood_audio_resources[] = { |
564 | [0] = { | 564 | [0] = { |
565 | .start = AUDIO_PHYS_BASE, | 565 | .start = AUDIO_PHYS_BASE, |
566 | .end = AUDIO_PHYS_BASE + SZ_16K - 1, | 566 | .end = AUDIO_PHYS_BASE + SZ_16K - 1, |
@@ -573,29 +573,23 @@ static struct resource kirkwood_i2s_resources[] = { | |||
573 | }, | 573 | }, |
574 | }; | 574 | }; |
575 | 575 | ||
576 | static struct kirkwood_asoc_platform_data kirkwood_i2s_data = { | 576 | static struct kirkwood_asoc_platform_data kirkwood_audio_data = { |
577 | .burst = 128, | 577 | .burst = 128, |
578 | }; | 578 | }; |
579 | 579 | ||
580 | static struct platform_device kirkwood_i2s_device = { | 580 | static struct platform_device kirkwood_audio_device = { |
581 | .name = "kirkwood-i2s", | 581 | .name = "mvebu-audio", |
582 | .id = -1, | 582 | .id = -1, |
583 | .num_resources = ARRAY_SIZE(kirkwood_i2s_resources), | 583 | .num_resources = ARRAY_SIZE(kirkwood_audio_resources), |
584 | .resource = kirkwood_i2s_resources, | 584 | .resource = kirkwood_audio_resources, |
585 | .dev = { | 585 | .dev = { |
586 | .platform_data = &kirkwood_i2s_data, | 586 | .platform_data = &kirkwood_audio_data, |
587 | }, | 587 | }, |
588 | }; | 588 | }; |
589 | 589 | ||
590 | static struct platform_device kirkwood_pcm_device = { | ||
591 | .name = "kirkwood-pcm-audio", | ||
592 | .id = -1, | ||
593 | }; | ||
594 | |||
595 | void __init kirkwood_audio_init(void) | 590 | void __init kirkwood_audio_init(void) |
596 | { | 591 | { |
597 | platform_device_register(&kirkwood_i2s_device); | 592 | platform_device_register(&kirkwood_audio_device); |
598 | platform_device_register(&kirkwood_pcm_device); | ||
599 | } | 593 | } |
600 | 594 | ||
601 | /***************************************************************************** | 595 | /***************************************************************************** |
diff --git a/sound/soc/kirkwood/Kconfig b/sound/soc/kirkwood/Kconfig index 59085ad6c41a..9e1970c44e86 100644 --- a/sound/soc/kirkwood/Kconfig +++ b/sound/soc/kirkwood/Kconfig | |||
@@ -6,14 +6,10 @@ config SND_KIRKWOOD_SOC | |||
6 | the Kirkwood I2S interface. You will also need to select the | 6 | the Kirkwood I2S interface. You will also need to select the |
7 | audio interfaces to support below. | 7 | audio interfaces to support below. |
8 | 8 | ||
9 | config SND_KIRKWOOD_SOC_I2S | ||
10 | tristate | ||
11 | |||
12 | config SND_KIRKWOOD_SOC_OPENRD | 9 | config SND_KIRKWOOD_SOC_OPENRD |
13 | tristate "SoC Audio support for Kirkwood Openrd Client" | 10 | tristate "SoC Audio support for Kirkwood Openrd Client" |
14 | depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE || COMPILE_TEST) | 11 | depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE || COMPILE_TEST) |
15 | depends on I2C | 12 | depends on I2C |
16 | select SND_KIRKWOOD_SOC_I2S | ||
17 | select SND_SOC_CS42L51 | 13 | select SND_SOC_CS42L51 |
18 | help | 14 | help |
19 | Say Y if you want to add support for SoC audio on | 15 | Say Y if you want to add support for SoC audio on |
@@ -22,7 +18,6 @@ config SND_KIRKWOOD_SOC_OPENRD | |||
22 | config SND_KIRKWOOD_SOC_T5325 | 18 | config SND_KIRKWOOD_SOC_T5325 |
23 | tristate "SoC Audio support for HP t5325" | 19 | tristate "SoC Audio support for HP t5325" |
24 | depends on SND_KIRKWOOD_SOC && (MACH_T5325 || COMPILE_TEST) && I2C | 20 | depends on SND_KIRKWOOD_SOC && (MACH_T5325 || COMPILE_TEST) && I2C |
25 | select SND_KIRKWOOD_SOC_I2S | ||
26 | select SND_SOC_ALC5623 | 21 | select SND_SOC_ALC5623 |
27 | help | 22 | help |
28 | Say Y if you want to add support for SoC audio on | 23 | Say Y if you want to add support for SoC audio on |
diff --git a/sound/soc/kirkwood/Makefile b/sound/soc/kirkwood/Makefile index 3e62ae9e7bbe..9e781385cb88 100644 --- a/sound/soc/kirkwood/Makefile +++ b/sound/soc/kirkwood/Makefile | |||
@@ -1,8 +1,6 @@ | |||
1 | snd-soc-kirkwood-objs := kirkwood-dma.o | 1 | snd-soc-kirkwood-objs := kirkwood-dma.o kirkwood-i2s.o |
2 | snd-soc-kirkwood-i2s-objs := kirkwood-i2s.o | ||
3 | 2 | ||
4 | obj-$(CONFIG_SND_KIRKWOOD_SOC) += snd-soc-kirkwood.o | 3 | obj-$(CONFIG_SND_KIRKWOOD_SOC) += snd-soc-kirkwood.o |
5 | obj-$(CONFIG_SND_KIRKWOOD_SOC_I2S) += snd-soc-kirkwood-i2s.o | ||
6 | 4 | ||
7 | snd-soc-openrd-objs := kirkwood-openrd.o | 5 | snd-soc-openrd-objs := kirkwood-openrd.o |
8 | snd-soc-t5325-objs := kirkwood-t5325.o | 6 | snd-soc-t5325-objs := kirkwood-t5325.o |
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index ba50dd156c67..01622f6358df 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c | |||
@@ -334,36 +334,8 @@ static void kirkwood_dma_free_dma_buffers(struct snd_pcm *pcm) | |||
334 | } | 334 | } |
335 | } | 335 | } |
336 | 336 | ||
337 | static struct snd_soc_platform_driver kirkwood_soc_platform = { | 337 | struct snd_soc_platform_driver kirkwood_soc_platform = { |
338 | .ops = &kirkwood_dma_ops, | 338 | .ops = &kirkwood_dma_ops, |
339 | .pcm_new = kirkwood_dma_new, | 339 | .pcm_new = kirkwood_dma_new, |
340 | .pcm_free = kirkwood_dma_free_dma_buffers, | 340 | .pcm_free = kirkwood_dma_free_dma_buffers, |
341 | }; | 341 | }; |
342 | |||
343 | static int kirkwood_soc_platform_probe(struct platform_device *pdev) | ||
344 | { | ||
345 | return snd_soc_register_platform(&pdev->dev, &kirkwood_soc_platform); | ||
346 | } | ||
347 | |||
348 | static int kirkwood_soc_platform_remove(struct platform_device *pdev) | ||
349 | { | ||
350 | snd_soc_unregister_platform(&pdev->dev); | ||
351 | return 0; | ||
352 | } | ||
353 | |||
354 | static struct platform_driver kirkwood_pcm_driver = { | ||
355 | .driver = { | ||
356 | .name = "kirkwood-pcm-audio", | ||
357 | .owner = THIS_MODULE, | ||
358 | }, | ||
359 | |||
360 | .probe = kirkwood_soc_platform_probe, | ||
361 | .remove = kirkwood_soc_platform_remove, | ||
362 | }; | ||
363 | |||
364 | module_platform_driver(kirkwood_pcm_driver); | ||
365 | |||
366 | MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); | ||
367 | MODULE_DESCRIPTION("Marvell Kirkwood Audio DMA module"); | ||
368 | MODULE_LICENSE("GPL"); | ||
369 | MODULE_ALIAS("platform:kirkwood-pcm-audio"); | ||
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index ad1c789637b2..e5f3f7a9ea26 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/platform_data/asoc-kirkwood.h> | 24 | #include <linux/platform_data/asoc-kirkwood.h> |
25 | #include "kirkwood.h" | 25 | #include "kirkwood.h" |
26 | 26 | ||
27 | #define DRV_NAME "kirkwood-i2s" | 27 | #define DRV_NAME "mvebu-audio" |
28 | 28 | ||
29 | #define KIRKWOOD_I2S_FORMATS \ | 29 | #define KIRKWOOD_I2S_FORMATS \ |
30 | (SNDRV_PCM_FMTBIT_S16_LE | \ | 30 | (SNDRV_PCM_FMTBIT_S16_LE | \ |
@@ -517,10 +517,20 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev) | |||
517 | 517 | ||
518 | err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component, | 518 | err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component, |
519 | soc_dai, 1); | 519 | soc_dai, 1); |
520 | if (!err) | 520 | if (err) { |
521 | return 0; | 521 | dev_err(&pdev->dev, "snd_soc_register_component failed\n"); |
522 | dev_err(&pdev->dev, "snd_soc_register_component failed\n"); | 522 | goto err_component; |
523 | } | ||
523 | 524 | ||
525 | err = snd_soc_register_platform(&pdev->dev, &kirkwood_soc_platform); | ||
526 | if (err) { | ||
527 | dev_err(&pdev->dev, "snd_soc_register_platform failed\n"); | ||
528 | goto err_platform; | ||
529 | } | ||
530 | return 0; | ||
531 | err_platform: | ||
532 | snd_soc_unregister_component(&pdev->dev); | ||
533 | err_component: | ||
524 | if (!IS_ERR(priv->extclk)) | 534 | if (!IS_ERR(priv->extclk)) |
525 | clk_disable_unprepare(priv->extclk); | 535 | clk_disable_unprepare(priv->extclk); |
526 | clk_disable_unprepare(priv->clk); | 536 | clk_disable_unprepare(priv->clk); |
@@ -532,6 +542,7 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev) | |||
532 | { | 542 | { |
533 | struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); | 543 | struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); |
534 | 544 | ||
545 | snd_soc_unregister_platform(&pdev->dev); | ||
535 | snd_soc_unregister_component(&pdev->dev); | 546 | snd_soc_unregister_component(&pdev->dev); |
536 | 547 | ||
537 | if (!IS_ERR(priv->extclk)) | 548 | if (!IS_ERR(priv->extclk)) |
@@ -556,4 +567,4 @@ module_platform_driver(kirkwood_i2s_driver); | |||
556 | MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>"); | 567 | MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>"); |
557 | MODULE_DESCRIPTION("Kirkwood I2S SoC Interface"); | 568 | MODULE_DESCRIPTION("Kirkwood I2S SoC Interface"); |
558 | MODULE_LICENSE("GPL"); | 569 | MODULE_LICENSE("GPL"); |
559 | MODULE_ALIAS("platform:kirkwood-i2s"); | 570 | MODULE_ALIAS("platform:mvebu-audio"); |
diff --git a/sound/soc/kirkwood/kirkwood-openrd.c b/sound/soc/kirkwood/kirkwood-openrd.c index addbebc2b3fa..025be0e97164 100644 --- a/sound/soc/kirkwood/kirkwood-openrd.c +++ b/sound/soc/kirkwood/kirkwood-openrd.c | |||
@@ -52,8 +52,8 @@ static struct snd_soc_dai_link openrd_client_dai[] = { | |||
52 | { | 52 | { |
53 | .name = "CS42L51", | 53 | .name = "CS42L51", |
54 | .stream_name = "CS42L51 HiFi", | 54 | .stream_name = "CS42L51 HiFi", |
55 | .cpu_dai_name = "kirkwood-i2s", | 55 | .cpu_dai_name = "mvebu-audio", |
56 | .platform_name = "kirkwood-pcm-audio", | 56 | .platform_name = "mvebu-audio", |
57 | .codec_dai_name = "cs42l51-hifi", | 57 | .codec_dai_name = "cs42l51-hifi", |
58 | .codec_name = "cs42l51-codec.0-004a", | 58 | .codec_name = "cs42l51-codec.0-004a", |
59 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, | 59 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, |
diff --git a/sound/soc/kirkwood/kirkwood-t5325.c b/sound/soc/kirkwood/kirkwood-t5325.c index 4f4cb56f765a..27545b0c4856 100644 --- a/sound/soc/kirkwood/kirkwood-t5325.c +++ b/sound/soc/kirkwood/kirkwood-t5325.c | |||
@@ -68,8 +68,8 @@ static struct snd_soc_dai_link t5325_dai[] = { | |||
68 | { | 68 | { |
69 | .name = "ALC5621", | 69 | .name = "ALC5621", |
70 | .stream_name = "ALC5621 HiFi", | 70 | .stream_name = "ALC5621 HiFi", |
71 | .cpu_dai_name = "kirkwood-i2s", | 71 | .cpu_dai_name = "mvebu-audio", |
72 | .platform_name = "kirkwood-pcm-audio", | 72 | .platform_name = "mvebu-audio", |
73 | .codec_dai_name = "alc5621-hifi", | 73 | .codec_dai_name = "alc5621-hifi", |
74 | .codec_name = "alc562x-codec.0-001a", | 74 | .codec_name = "alc562x-codec.0-001a", |
75 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, | 75 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, |
diff --git a/sound/soc/kirkwood/kirkwood.h b/sound/soc/kirkwood/kirkwood.h index 9a50607267cf..1d13dee93d90 100644 --- a/sound/soc/kirkwood/kirkwood.h +++ b/sound/soc/kirkwood/kirkwood.h | |||
@@ -138,4 +138,6 @@ struct kirkwood_dma_data { | |||
138 | int burst; | 138 | int burst; |
139 | }; | 139 | }; |
140 | 140 | ||
141 | extern struct snd_soc_platform_driver kirkwood_soc_platform; | ||
142 | |||
141 | #endif | 143 | #endif |