aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2011-07-25 07:44:46 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-07-27 14:10:48 -0400
commitb2ce305dda483e59a78d5aa6e4211034c0cea38d (patch)
tree995694664f2b2654a0ff121277ec59875da56d05
parentb3c70c9ea62a3ae6c63536e43fa28f965a56de91 (diff)
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 <manuel.lauss@googlemail.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--arch/mips/alchemy/devboards/db1x00/platform.c48
-rw-r--r--sound/soc/au1x/Kconfig9
-rw-r--r--sound/soc/au1x/Makefile2
-rw-r--r--sound/soc/au1x/db1000.c75
4 files changed, 134 insertions, 0 deletions
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 @@
19 */ 19 */
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/interrupt.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23 24
25#include <asm/mach-au1x00/au1000.h>
26#include <asm/mach-au1x00/au1000_dma.h>
24#include <asm/mach-au1x00/au1xxx.h> 27#include <asm/mach-au1x00/au1xxx.h>
25#include <asm/mach-db1x00/bcsr.h> 28#include <asm/mach-db1x00/bcsr.h>
26#include "../platform.h" 29#include "../platform.h"
@@ -85,6 +88,45 @@
85#endif 88#endif
86#endif 89#endif
87 90
91static struct resource alchemy_ac97c_res[] = {
92 [0] = {
93 .start = AU1000_AC97_PHYS_ADDR,
94 .end = AU1000_AC97_PHYS_ADDR + 0xfff,
95 .flags = IORESOURCE_MEM,
96 },
97 [1] = {
98 .start = DMA_ID_AC97C_TX,
99 .end = DMA_ID_AC97C_TX,
100 .flags = IORESOURCE_DMA,
101 },
102 [2] = {
103 .start = DMA_ID_AC97C_RX,
104 .end = DMA_ID_AC97C_RX,
105 .flags = IORESOURCE_DMA,
106 },
107};
108
109static struct platform_device alchemy_ac97c_dev = {
110 .name = "alchemy-ac97c",
111 .id = -1,
112 .resource = alchemy_ac97c_res,
113 .num_resources = ARRAY_SIZE(alchemy_ac97c_res),
114};
115
116static struct platform_device alchemy_ac97c_dma_dev = {
117 .name = "alchemy-pcm-dma",
118 .id = 0,
119};
120
121static struct platform_device db1x00_codec_dev = {
122 .name = "ac97-codec",
123 .id = -1,
124};
125
126static struct platform_device db1x00_audio_dev = {
127 .name = "db1000-audio",
128};
129
88static int __init db1xxx_dev_init(void) 130static int __init db1xxx_dev_init(void)
89{ 131{
90#ifdef DB1XXX_HAS_PCMCIA 132#ifdef DB1XXX_HAS_PCMCIA
@@ -113,6 +155,12 @@ static int __init db1xxx_dev_init(void)
113 1); 155 1);
114#endif 156#endif
115 db1x_register_norflash(BOARD_FLASH_SIZE, BOARD_FLASH_WIDTH, F_SWAPPED); 157 db1x_register_norflash(BOARD_FLASH_SIZE, BOARD_FLASH_WIDTH, F_SWAPPED);
158
159 platform_device_register(&db1x00_codec_dev);
160 platform_device_register(&alchemy_ac97c_dma_dev);
161 platform_device_register(&alchemy_ac97c_dev);
162 platform_device_register(&db1x00_audio_dev);
163
116 return 0; 164 return 0;
117} 165}
118device_initcall(db1xxx_dev_init); 166device_initcall(db1xxx_dev_init);
diff --git a/sound/soc/au1x/Kconfig b/sound/soc/au1x/Kconfig
index 0460b428862c..6d592546e8fc 100644
--- a/sound/soc/au1x/Kconfig
+++ b/sound/soc/au1x/Kconfig
@@ -41,6 +41,15 @@ config SND_SOC_AU1XI2SC
41## 41##
42## Boards 42## Boards
43## 43##
44config SND_SOC_DB1000
45 tristate "DB1000 Audio support"
46 depends on SND_SOC_AU1XAUDIO
47 select SND_SOC_AU1XAC97C
48 select SND_SOC_AC97_CODEC
49 help
50 Select this option to enable AC97 audio on the early DB1x00 series
51 of boards (DB1000/DB1500/DB1100).
52
44config SND_SOC_DB1200 53config SND_SOC_DB1200
45 tristate "DB1200 AC97+I2S audio support" 54 tristate "DB1200 AC97+I2S audio support"
46 depends on SND_SOC_AU1XPSC 55 depends on SND_SOC_AU1XPSC
diff --git a/sound/soc/au1x/Makefile b/sound/soc/au1x/Makefile
index ff5531eee613..920710514ea0 100644
--- a/sound/soc/au1x/Makefile
+++ b/sound/soc/au1x/Makefile
@@ -16,6 +16,8 @@ obj-$(CONFIG_SND_SOC_AU1XAC97C) += snd-soc-au1x-ac97c.o
16obj-$(CONFIG_SND_SOC_AU1XI2SC) += snd-soc-au1x-i2sc.o 16obj-$(CONFIG_SND_SOC_AU1XI2SC) += snd-soc-au1x-i2sc.o
17 17
18# Boards 18# Boards
19snd-soc-db1000-objs := db1000.o
19snd-soc-db1200-objs := db1200.o 20snd-soc-db1200-objs := db1200.o
20 21
22obj-$(CONFIG_SND_SOC_DB1000) += snd-soc-db1000.o
21obj-$(CONFIG_SND_SOC_DB1200) += snd-soc-db1200.o 23obj-$(CONFIG_SND_SOC_DB1200) += snd-soc-db1200.o
diff --git a/sound/soc/au1x/db1000.c b/sound/soc/au1x/db1000.c
new file mode 100644
index 000000000000..127477a5e0c7
--- /dev/null
+++ b/sound/soc/au1x/db1000.c
@@ -0,0 +1,75 @@
1/*
2 * DB1000/DB1500/DB1100 ASoC audio fabric support code.
3 *
4 * (c) 2011 Manuel Lauss <manuel.lauss@googlemail.com>
5 *
6 */
7
8#include <linux/module.h>
9#include <linux/moduleparam.h>
10#include <linux/timer.h>
11#include <linux/interrupt.h>
12#include <linux/platform_device.h>
13#include <sound/core.h>
14#include <sound/pcm.h>
15#include <sound/soc.h>
16#include <asm/mach-au1x00/au1000.h>
17#include <asm/mach-db1x00/bcsr.h>
18
19#include "psc.h"
20
21static struct snd_soc_dai_link db1000_ac97_dai = {
22 .name = "AC97",
23 .stream_name = "AC97 HiFi",
24 .codec_dai_name = "ac97-hifi",
25 .cpu_dai_name = "alchemy-ac97c",
26 .platform_name = "alchemy-pcm-dma.0",
27 .codec_name = "ac97-codec",
28};
29
30static struct snd_soc_card db1000_ac97 = {
31 .name = "DB1000_AC97",
32 .dai_link = &db1000_ac97_dai,
33 .num_links = 1,
34};
35
36static int __devinit db1000_audio_probe(struct platform_device *pdev)
37{
38 struct snd_soc_card *card = &db1000_ac97;
39 card->dev = &pdev->dev;
40 return snd_soc_register_card(card);
41}
42
43static int __devexit db1000_audio_remove(struct platform_device *pdev)
44{
45 struct snd_soc_card *card = platform_get_drvdata(pdev);
46 snd_soc_unregister_card(card);
47 return 0;
48}
49
50static struct platform_driver db1000_audio_driver = {
51 .driver = {
52 .name = "db1000-audio",
53 .owner = THIS_MODULE,
54 .pm = &snd_soc_pm_ops,
55 },
56 .probe = db1000_audio_probe,
57 .remove = __devexit_p(db1000_audio_remove),
58};
59
60static int __init db1000_audio_load(void)
61{
62 return platform_driver_register(&db1000_audio_driver);
63}
64
65static void __exit db1000_audio_unload(void)
66{
67 platform_driver_unregister(&db1000_audio_driver);
68}
69
70module_init(db1000_audio_load);
71module_exit(db1000_audio_unload);
72
73MODULE_LICENSE("GPL");
74MODULE_DESCRIPTION("DB1000/DB1500/DB1100 ASoC audio");
75MODULE_AUTHOR("Manuel Lauss");