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>
This commit is contained in:
Russell King 2013-08-04 20:27:03 +01:00 коммит произвёл Mark Brown
Родитель db43b16fa0
Коммит 64ddf1f89c
9 изменённых файлов: 35 добавлений и 63 удалений

Просмотреть файл

@ -108,8 +108,8 @@ static void __init dove_clk_init(void)
orion_clkdev_add(NULL, "sdhci-dove.1", sdio1); orion_clkdev_add(NULL, "sdhci-dove.1", sdio1);
orion_clkdev_add(NULL, "orion_nand", nand); orion_clkdev_add(NULL, "orion_nand", nand);
orion_clkdev_add(NULL, "cafe1000-ccic.0", camera); orion_clkdev_add(NULL, "cafe1000-ccic.0", camera);
orion_clkdev_add(NULL, "kirkwood-i2s.0", i2s0); orion_clkdev_add(NULL, "mvebu-audio.0", i2s0);
orion_clkdev_add(NULL, "kirkwood-i2s.1", i2s1); orion_clkdev_add(NULL, "mvebu-audio.1", i2s1);
orion_clkdev_add(NULL, "mv_crypto", crypto); orion_clkdev_add(NULL, "mv_crypto", crypto);
orion_clkdev_add(NULL, "dove-ac97", ac97); orion_clkdev_add(NULL, "dove-ac97", ac97);
orion_clkdev_add(NULL, "dove-pdma", pdma); orion_clkdev_add(NULL, "dove-pdma", pdma);

Просмотреть файл

@ -264,7 +264,7 @@ void __init kirkwood_clk_init(void)
orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1); orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1);
orion_clkdev_add("0", "pcie", pex0); orion_clkdev_add("0", "pcie", pex0);
orion_clkdev_add("1", "pcie", pex1); orion_clkdev_add("1", "pcie", pex1);
orion_clkdev_add(NULL, "kirkwood-i2s", audio); orion_clkdev_add(NULL, "mvebu-audio", audio);
orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit);
orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit); orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit);
@ -560,7 +560,7 @@ void __init kirkwood_timer_init(void)
/***************************************************************************** /*****************************************************************************
* Audio * Audio
****************************************************************************/ ****************************************************************************/
static struct resource kirkwood_i2s_resources[] = { static struct resource kirkwood_audio_resources[] = {
[0] = { [0] = {
.start = AUDIO_PHYS_BASE, .start = AUDIO_PHYS_BASE,
.end = AUDIO_PHYS_BASE + SZ_16K - 1, .end = AUDIO_PHYS_BASE + SZ_16K - 1,
@ -573,29 +573,23 @@ static struct resource kirkwood_i2s_resources[] = {
}, },
}; };
static struct kirkwood_asoc_platform_data kirkwood_i2s_data = { static struct kirkwood_asoc_platform_data kirkwood_audio_data = {
.burst = 128, .burst = 128,
}; };
static struct platform_device kirkwood_i2s_device = { static struct platform_device kirkwood_audio_device = {
.name = "kirkwood-i2s", .name = "mvebu-audio",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(kirkwood_i2s_resources), .num_resources = ARRAY_SIZE(kirkwood_audio_resources),
.resource = kirkwood_i2s_resources, .resource = kirkwood_audio_resources,
.dev = { .dev = {
.platform_data = &kirkwood_i2s_data, .platform_data = &kirkwood_audio_data,
}, },
}; };
static struct platform_device kirkwood_pcm_device = {
.name = "kirkwood-pcm-audio",
.id = -1,
};
void __init kirkwood_audio_init(void) void __init kirkwood_audio_init(void)
{ {
platform_device_register(&kirkwood_i2s_device); platform_device_register(&kirkwood_audio_device);
platform_device_register(&kirkwood_pcm_device);
} }
/***************************************************************************** /*****************************************************************************

Просмотреть файл

@ -6,14 +6,10 @@ config SND_KIRKWOOD_SOC
the Kirkwood I2S interface. You will also need to select the the Kirkwood I2S interface. You will also need to select the
audio interfaces to support below. audio interfaces to support below.
config SND_KIRKWOOD_SOC_I2S
tristate
config SND_KIRKWOOD_SOC_OPENRD config SND_KIRKWOOD_SOC_OPENRD
tristate "SoC Audio support for Kirkwood Openrd Client" tristate "SoC Audio support for Kirkwood Openrd Client"
depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE || COMPILE_TEST) depends on SND_KIRKWOOD_SOC && (MACH_OPENRD_CLIENT || MACH_OPENRD_ULTIMATE || COMPILE_TEST)
depends on I2C depends on I2C
select SND_KIRKWOOD_SOC_I2S
select SND_SOC_CS42L51 select SND_SOC_CS42L51
help help
Say Y if you want to add support for SoC audio on Say Y if you want to add support for SoC audio on
@ -22,7 +18,6 @@ config SND_KIRKWOOD_SOC_OPENRD
config SND_KIRKWOOD_SOC_T5325 config SND_KIRKWOOD_SOC_T5325
tristate "SoC Audio support for HP t5325" tristate "SoC Audio support for HP t5325"
depends on SND_KIRKWOOD_SOC && (MACH_T5325 || COMPILE_TEST) && I2C depends on SND_KIRKWOOD_SOC && (MACH_T5325 || COMPILE_TEST) && I2C
select SND_KIRKWOOD_SOC_I2S
select SND_SOC_ALC5623 select SND_SOC_ALC5623
help help
Say Y if you want to add support for SoC audio on Say Y if you want to add support for SoC audio on

Просмотреть файл

@ -1,8 +1,6 @@
snd-soc-kirkwood-objs := kirkwood-dma.o snd-soc-kirkwood-objs := kirkwood-dma.o kirkwood-i2s.o
snd-soc-kirkwood-i2s-objs := kirkwood-i2s.o
obj-$(CONFIG_SND_KIRKWOOD_SOC) += snd-soc-kirkwood.o obj-$(CONFIG_SND_KIRKWOOD_SOC) += snd-soc-kirkwood.o
obj-$(CONFIG_SND_KIRKWOOD_SOC_I2S) += snd-soc-kirkwood-i2s.o
snd-soc-openrd-objs := kirkwood-openrd.o snd-soc-openrd-objs := kirkwood-openrd.o
snd-soc-t5325-objs := kirkwood-t5325.o snd-soc-t5325-objs := kirkwood-t5325.o

Просмотреть файл

@ -334,36 +334,8 @@ static void kirkwood_dma_free_dma_buffers(struct snd_pcm *pcm)
} }
} }
static struct snd_soc_platform_driver kirkwood_soc_platform = { struct snd_soc_platform_driver kirkwood_soc_platform = {
.ops = &kirkwood_dma_ops, .ops = &kirkwood_dma_ops,
.pcm_new = kirkwood_dma_new, .pcm_new = kirkwood_dma_new,
.pcm_free = kirkwood_dma_free_dma_buffers, .pcm_free = kirkwood_dma_free_dma_buffers,
}; };
static int kirkwood_soc_platform_probe(struct platform_device *pdev)
{
return snd_soc_register_platform(&pdev->dev, &kirkwood_soc_platform);
}
static int kirkwood_soc_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_platform(&pdev->dev);
return 0;
}
static struct platform_driver kirkwood_pcm_driver = {
.driver = {
.name = "kirkwood-pcm-audio",
.owner = THIS_MODULE,
},
.probe = kirkwood_soc_platform_probe,
.remove = kirkwood_soc_platform_remove,
};
module_platform_driver(kirkwood_pcm_driver);
MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("Marvell Kirkwood Audio DMA module");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:kirkwood-pcm-audio");

Просмотреть файл

@ -24,7 +24,7 @@
#include <linux/platform_data/asoc-kirkwood.h> #include <linux/platform_data/asoc-kirkwood.h>
#include "kirkwood.h" #include "kirkwood.h"
#define DRV_NAME "kirkwood-i2s" #define DRV_NAME "mvebu-audio"
#define KIRKWOOD_I2S_FORMATS \ #define KIRKWOOD_I2S_FORMATS \
(SNDRV_PCM_FMTBIT_S16_LE | \ (SNDRV_PCM_FMTBIT_S16_LE | \
@ -517,10 +517,20 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component, err = snd_soc_register_component(&pdev->dev, &kirkwood_i2s_component,
soc_dai, 1); soc_dai, 1);
if (!err) if (err) {
return 0; dev_err(&pdev->dev, "snd_soc_register_component failed\n");
dev_err(&pdev->dev, "snd_soc_register_component failed\n"); goto err_component;
}
err = snd_soc_register_platform(&pdev->dev, &kirkwood_soc_platform);
if (err) {
dev_err(&pdev->dev, "snd_soc_register_platform failed\n");
goto err_platform;
}
return 0;
err_platform:
snd_soc_unregister_component(&pdev->dev);
err_component:
if (!IS_ERR(priv->extclk)) if (!IS_ERR(priv->extclk))
clk_disable_unprepare(priv->extclk); clk_disable_unprepare(priv->extclk);
clk_disable_unprepare(priv->clk); clk_disable_unprepare(priv->clk);
@ -532,6 +542,7 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
{ {
struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_platform(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
if (!IS_ERR(priv->extclk)) if (!IS_ERR(priv->extclk))
@ -556,4 +567,4 @@ module_platform_driver(kirkwood_i2s_driver);
MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>"); MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("Kirkwood I2S SoC Interface"); MODULE_DESCRIPTION("Kirkwood I2S SoC Interface");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:kirkwood-i2s"); MODULE_ALIAS("platform:mvebu-audio");

Просмотреть файл

@ -52,8 +52,8 @@ static struct snd_soc_dai_link openrd_client_dai[] = {
{ {
.name = "CS42L51", .name = "CS42L51",
.stream_name = "CS42L51 HiFi", .stream_name = "CS42L51 HiFi",
.cpu_dai_name = "kirkwood-i2s", .cpu_dai_name = "mvebu-audio",
.platform_name = "kirkwood-pcm-audio", .platform_name = "mvebu-audio",
.codec_dai_name = "cs42l51-hifi", .codec_dai_name = "cs42l51-hifi",
.codec_name = "cs42l51-codec.0-004a", .codec_name = "cs42l51-codec.0-004a",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS,

Просмотреть файл

@ -68,8 +68,8 @@ static struct snd_soc_dai_link t5325_dai[] = {
{ {
.name = "ALC5621", .name = "ALC5621",
.stream_name = "ALC5621 HiFi", .stream_name = "ALC5621 HiFi",
.cpu_dai_name = "kirkwood-i2s", .cpu_dai_name = "mvebu-audio",
.platform_name = "kirkwood-pcm-audio", .platform_name = "mvebu-audio",
.codec_dai_name = "alc5621-hifi", .codec_dai_name = "alc5621-hifi",
.codec_name = "alc562x-codec.0-001a", .codec_name = "alc562x-codec.0-001a",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS,

Просмотреть файл

@ -138,4 +138,6 @@ struct kirkwood_dma_data {
int burst; int burst;
}; };
extern struct snd_soc_platform_driver kirkwood_soc_platform;
#endif #endif