From b2ce305dda483e59a78d5aa6e4211034c0cea38d Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Mon, 25 Jul 2011 13:44:46 +0200 Subject: ASoC: Add a DB1x00 AC97 machine driver Add a machine driver suitable for the AC97 part on the DB1000/DB1500/DB1100 boards. Run-tested on DB1500. Signed-off-by: Manuel Lauss Acked-by: Ralf Baechle Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- arch/mips/alchemy/devboards/db1x00/platform.c | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'arch/mips/alchemy') diff --git a/arch/mips/alchemy/devboards/db1x00/platform.c b/arch/mips/alchemy/devboards/db1x00/platform.c index 978d5ab3d678..7057d28f7301 100644 --- a/arch/mips/alchemy/devboards/db1x00/platform.c +++ b/arch/mips/alchemy/devboards/db1x00/platform.c @@ -19,8 +19,11 @@ */ #include +#include #include +#include +#include #include #include #include "../platform.h" @@ -85,6 +88,45 @@ #endif #endif +static struct resource alchemy_ac97c_res[] = { + [0] = { + .start = AU1000_AC97_PHYS_ADDR, + .end = AU1000_AC97_PHYS_ADDR + 0xfff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = DMA_ID_AC97C_TX, + .end = DMA_ID_AC97C_TX, + .flags = IORESOURCE_DMA, + }, + [2] = { + .start = DMA_ID_AC97C_RX, + .end = DMA_ID_AC97C_RX, + .flags = IORESOURCE_DMA, + }, +}; + +static struct platform_device alchemy_ac97c_dev = { + .name = "alchemy-ac97c", + .id = -1, + .resource = alchemy_ac97c_res, + .num_resources = ARRAY_SIZE(alchemy_ac97c_res), +}; + +static struct platform_device alchemy_ac97c_dma_dev = { + .name = "alchemy-pcm-dma", + .id = 0, +}; + +static struct platform_device db1x00_codec_dev = { + .name = "ac97-codec", + .id = -1, +}; + +static struct platform_device db1x00_audio_dev = { + .name = "db1000-audio", +}; + static int __init db1xxx_dev_init(void) { #ifdef DB1XXX_HAS_PCMCIA @@ -113,6 +155,12 @@ static int __init db1xxx_dev_init(void) 1); #endif db1x_register_norflash(BOARD_FLASH_SIZE, BOARD_FLASH_WIDTH, F_SWAPPED); + + platform_device_register(&db1x00_codec_dev); + platform_device_register(&alchemy_ac97c_dma_dev); + platform_device_register(&alchemy_ac97c_dev); + platform_device_register(&db1x00_audio_dev); + return 0; } device_initcall(db1xxx_dev_init); -- cgit v1.2.3 From 5b0912be7a8ff1dbfe56358c5f933d65445bb8af Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Mon, 25 Jul 2011 13:45:02 +0200 Subject: ASoC: au1x: remove automatic DMA device registration from PSC drivers The PSC audio drivers (psc-ac97/psc-i2s) register the DMA platform_device on their own. This is frowned upon, from now on board code must register a simple pcm dma platform device for each PSC with sound duties. Signed-off-by: Manuel Lauss Acked-by: Ralf Baechle Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- arch/mips/alchemy/devboards/db1200/platform.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/mips/alchemy') diff --git a/arch/mips/alchemy/devboards/db1200/platform.c b/arch/mips/alchemy/devboards/db1200/platform.c index fbb55935b99e..cfb71aed4cb9 100644 --- a/arch/mips/alchemy/devboards/db1200/platform.c +++ b/arch/mips/alchemy/devboards/db1200/platform.c @@ -434,12 +434,18 @@ static struct platform_device db1200_stac_dev = { .id = 1, /* on PSC1 */ }; +static struct platform_device db1200_audiodma_dev = { + .name = "au1xpsc-pcm", + .id = 1, /* PSC ID */ +}; + static struct platform_device *db1200_devs[] __initdata = { NULL, /* PSC0, selected by S6.8 */ &db1200_ide_dev, &db1200_eth_dev, &db1200_rtc_dev, &db1200_nand_dev, + &db1200_audiodma_dev, &db1200_audio_dev, &db1200_stac_dev, }; -- cgit v1.2.3 From adbc7a5a61ee9225e0b80d3f5719e05a88db2b4c Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Mon, 25 Jul 2011 13:45:03 +0200 Subject: ASoC: au1x: update db1200 machine to the new way of things The use of the "soc-audio" platform device is no longer en vogue, update the code to the newer, simpler way of doing things. Signed-off-by: Manuel Lauss Acked-by: Ralf Baechle Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- arch/mips/alchemy/devboards/db1200/platform.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/mips/alchemy') diff --git a/arch/mips/alchemy/devboards/db1200/platform.c b/arch/mips/alchemy/devboards/db1200/platform.c index cfb71aed4cb9..dda090bf74e6 100644 --- a/arch/mips/alchemy/devboards/db1200/platform.c +++ b/arch/mips/alchemy/devboards/db1200/platform.c @@ -422,6 +422,7 @@ static struct resource au1200_psc1_res[] = { }, }; +/* AC97 or I2S device */ static struct platform_device db1200_audio_dev = { /* name assigned later based on switch setting */ .id = 1, /* PSC ID */ @@ -429,6 +430,12 @@ static struct platform_device db1200_audio_dev = { .resource = au1200_psc1_res, }; +/* DB1200 ASoC card device */ +static struct platform_device db1200_sound_dev = { + /* name assigned later based on switch setting */ + .id = 1, /* PSC ID */ +}; + static struct platform_device db1200_stac_dev = { .name = "ac97-codec", .id = 1, /* on PSC1 */ @@ -448,6 +455,7 @@ static struct platform_device *db1200_devs[] __initdata = { &db1200_audiodma_dev, &db1200_audio_dev, &db1200_stac_dev, + &db1200_sound_dev, }; static int __init db1200_dev_init(void) @@ -507,10 +515,12 @@ static int __init db1200_dev_init(void) if (sw == BCSR_SWITCHES_DIP_8) { bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC1MUX); db1200_audio_dev.name = "au1xpsc_i2s"; + db1200_sound_dev.name = "db1200-i2s"; printk(KERN_INFO " S6.7 ON : PSC1 mode I2S\n"); } else { bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC1MUX, 0); db1200_audio_dev.name = "au1xpsc_ac97"; + db1200_sound_dev.name = "db1200-ac97"; printk(KERN_INFO " S6.7 OFF: PSC1 mode AC97\n"); } -- cgit v1.2.3