aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-15 12:14:04 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-15 12:14:04 -0400
commit1837ce352d4c05a9d0fc86e743b0ec2ea775fd38 (patch)
tree56e8f2b083c976b11e63aa5264123a33ccc03fc9 /sound/soc/omap
parent3876566a368b30908ec4195d58f04a411f22f736 (diff)
parent152c6e56f6a8577bd291f6f4ca897e5758332a1b (diff)
Merge remote-tracking branch 'asoc/topic/omap' into for-3.7
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/Kconfig48
-rw-r--r--sound/soc/omap/Makefile10
-rw-r--r--sound/soc/omap/igep0020.c120
-rw-r--r--sound/soc/omap/omap-twl4030.c188
-rw-r--r--sound/soc/omap/omap3beagle.c150
-rw-r--r--sound/soc/omap/omap3evm.c118
-rw-r--r--sound/soc/omap/overo.c122
7 files changed, 203 insertions, 553 deletions
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 57a2fa751085..2c484a52ef92 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -60,23 +60,6 @@ config SND_OMAP_SOC_OSK5912
60 help 60 help
61 Say Y if you want to add support for SoC audio on osk5912. 61 Say Y if you want to add support for SoC audio on osk5912.
62 62
63config SND_OMAP_SOC_OVERO
64 tristate "SoC Audio support for Gumstix Overo and CompuLab CM-T35"
65 depends on TWL4030_CORE && SND_OMAP_SOC && (MACH_OVERO || MACH_CM_T35)
66 select SND_OMAP_SOC_MCBSP
67 select SND_SOC_TWL4030
68 help
69 Say Y if you want to add support for SoC audio on the
70 Gumstix Overo or CompuLab CM-T35
71
72config SND_OMAP_SOC_OMAP3EVM
73 tristate "SoC Audio support for OMAP3EVM board"
74 depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3EVM
75 select SND_OMAP_SOC_MCBSP
76 select SND_SOC_TWL4030
77 help
78 Say Y if you want to add support for SoC audio on the omap3evm board.
79
80config SND_OMAP_SOC_AM3517EVM 63config SND_OMAP_SOC_AM3517EVM
81 tristate "SoC Audio support for OMAP3517 / AM3517 EVM" 64 tristate "SoC Audio support for OMAP3517 / AM3517 EVM"
82 depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C 65 depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C
@@ -95,6 +78,19 @@ config SND_OMAP_SOC_SDP3430
95 Say Y if you want to add support for SoC audio on Texas Instruments 78 Say Y if you want to add support for SoC audio on Texas Instruments
96 SDP3430. 79 SDP3430.
97 80
81config SND_OMAP_SOC_OMAP_TWL4030
82 tristate "SoC Audio support for TI SoC based boards with twl4030 codec"
83 depends on TWL4030_CORE && SND_OMAP_SOC
84 select SND_OMAP_SOC_MCBSP
85 select SND_SOC_TWL4030
86 help
87 Say Y if you want to add support for SoC audio on TI SoC based boards
88 using twl4030 as c codec. This driver currently supports:
89 - Beagleboard or Devkit8000
90 - Gumstix Overo or CompuLab CM-T35/CM-T3730
91 - IGEP v2
92 - OMAP3EVM
93
98config SND_OMAP_SOC_OMAP_ABE_TWL6040 94config SND_OMAP_SOC_OMAP_ABE_TWL6040
99 tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" 95 tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
100 depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4 96 depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4
@@ -127,16 +123,6 @@ config SND_OMAP_SOC_OMAP3_PANDORA
127 help 123 help
128 Say Y if you want to add support for SoC audio on the OMAP3 Pandora. 124 Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
129 125
130config SND_OMAP_SOC_OMAP3_BEAGLE
131 tristate "SoC Audio support for OMAP3 Beagle and Devkit8000"
132 depends on TWL4030_CORE && SND_OMAP_SOC
133 depends on (MACH_OMAP3_BEAGLE || MACH_DEVKIT8000)
134 select SND_OMAP_SOC_MCBSP
135 select SND_SOC_TWL4030
136 help
137 Say Y if you want to add support for SoC audio on the Beagleboard or
138 the clone Devkit8000.
139
140config SND_OMAP_SOC_ZOOM2 126config SND_OMAP_SOC_ZOOM2
141 tristate "SoC Audio support for Zoom2" 127 tristate "SoC Audio support for Zoom2"
142 depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2 128 depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2
@@ -144,11 +130,3 @@ config SND_OMAP_SOC_ZOOM2
144 select SND_SOC_TWL4030 130 select SND_SOC_TWL4030
145 help 131 help
146 Say Y if you want to add support for Soc audio on Zoom2 board. 132 Say Y if you want to add support for Soc audio on Zoom2 board.
147
148config SND_OMAP_SOC_IGEP0020
149 tristate "SoC Audio support for IGEP v2"
150 depends on TWL4030_CORE && SND_OMAP_SOC && MACH_IGEP0020
151 select SND_OMAP_SOC_MCBSP
152 select SND_SOC_TWL4030
153 help
154 Say Y if you want to add support for Soc audio on IGEP v2 board.
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 0e14dd322565..19637e55ea48 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -16,29 +16,23 @@ snd-soc-n810-objs := n810.o
16snd-soc-rx51-objs := rx51.o 16snd-soc-rx51-objs := rx51.o
17snd-soc-ams-delta-objs := ams-delta.o 17snd-soc-ams-delta-objs := ams-delta.o
18snd-soc-osk5912-objs := osk5912.o 18snd-soc-osk5912-objs := osk5912.o
19snd-soc-overo-objs := overo.o
20snd-soc-omap3evm-objs := omap3evm.o
21snd-soc-am3517evm-objs := am3517evm.o 19snd-soc-am3517evm-objs := am3517evm.o
22snd-soc-sdp3430-objs := sdp3430.o 20snd-soc-sdp3430-objs := sdp3430.o
23snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o 21snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
22snd-soc-omap-twl4030-objs := omap-twl4030.o
24snd-soc-omap3pandora-objs := omap3pandora.o 23snd-soc-omap3pandora-objs := omap3pandora.o
25snd-soc-omap3beagle-objs := omap3beagle.o
26snd-soc-zoom2-objs := zoom2.o 24snd-soc-zoom2-objs := zoom2.o
27snd-soc-igep0020-objs := igep0020.o
28snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o 25snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o
29 26
30obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o 27obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
31obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o 28obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o
32obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA) += snd-soc-ams-delta.o 29obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA) += snd-soc-ams-delta.o
33obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o 30obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
34obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
35obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o 31obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o
36obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o
37obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o 32obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
38obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o 33obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
39obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o 34obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
35obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o
40obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o 36obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
41obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
42obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o 37obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
43obj-$(CONFIG_SND_OMAP_SOC_IGEP0020) += snd-soc-igep0020.o
44obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o 38obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
diff --git a/sound/soc/omap/igep0020.c b/sound/soc/omap/igep0020.c
deleted file mode 100644
index e8357819175b..000000000000
--- a/sound/soc/omap/igep0020.c
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * igep0020.c -- SoC audio for IGEP v2
3 *
4 * Based on sound/soc/omap/overo.c by Steve Sakoman
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <linux/clk.h>
23#include <linux/platform_device.h>
24#include <linux/module.h>
25#include <sound/core.h>
26#include <sound/pcm.h>
27#include <sound/soc.h>
28
29#include <asm/mach-types.h>
30#include <mach/hardware.h>
31#include <mach/gpio.h>
32#include <plat/mcbsp.h>
33
34#include "omap-mcbsp.h"
35#include "omap-pcm.h"
36
37static int igep2_hw_params(struct snd_pcm_substream *substream,
38 struct snd_pcm_hw_params *params)
39{
40 struct snd_soc_pcm_runtime *rtd = substream->private_data;
41 struct snd_soc_dai *codec_dai = rtd->codec_dai;
42 int ret;
43
44 /* Set the codec system clock for DAC and ADC */
45 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
46 SND_SOC_CLOCK_IN);
47 if (ret < 0) {
48 printk(KERN_ERR "can't set codec system clock\n");
49 return ret;
50 }
51
52 return 0;
53}
54
55static struct snd_soc_ops igep2_ops = {
56 .hw_params = igep2_hw_params,
57};
58
59/* Digital audio interface glue - connects codec <--> CPU */
60static struct snd_soc_dai_link igep2_dai = {
61 .name = "TWL4030",
62 .stream_name = "TWL4030",
63 .cpu_dai_name = "omap-mcbsp.2",
64 .codec_dai_name = "twl4030-hifi",
65 .platform_name = "omap-pcm-audio",
66 .codec_name = "twl4030-codec",
67 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
68 SND_SOC_DAIFMT_CBM_CFM,
69 .ops = &igep2_ops,
70};
71
72/* Audio machine driver */
73static struct snd_soc_card snd_soc_card_igep2 = {
74 .name = "igep2",
75 .owner = THIS_MODULE,
76 .dai_link = &igep2_dai,
77 .num_links = 1,
78};
79
80static struct platform_device *igep2_snd_device;
81
82static int __init igep2_soc_init(void)
83{
84 int ret;
85
86 if (!machine_is_igep0020())
87 return -ENODEV;
88 printk(KERN_INFO "IGEP v2 SoC init\n");
89
90 igep2_snd_device = platform_device_alloc("soc-audio", -1);
91 if (!igep2_snd_device) {
92 printk(KERN_ERR "Platform device allocation failed\n");
93 return -ENOMEM;
94 }
95
96 platform_set_drvdata(igep2_snd_device, &snd_soc_card_igep2);
97
98 ret = platform_device_add(igep2_snd_device);
99 if (ret)
100 goto err1;
101
102 return 0;
103
104err1:
105 printk(KERN_ERR "Unable to add platform device\n");
106 platform_device_put(igep2_snd_device);
107
108 return ret;
109}
110module_init(igep2_soc_init);
111
112static void __exit igep2_soc_exit(void)
113{
114 platform_device_unregister(igep2_snd_device);
115}
116module_exit(igep2_soc_exit);
117
118MODULE_AUTHOR("Enric Balletbo i Serra <eballetbo@iseebcn.com>");
119MODULE_DESCRIPTION("ALSA SoC IGEP v2");
120MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c
new file mode 100644
index 000000000000..3b97b87971f5
--- /dev/null
+++ b/sound/soc/omap/omap-twl4030.c
@@ -0,0 +1,188 @@
1/*
2 * omap-twl4030.c -- SoC audio for TI SoC based boards with twl4030 codec
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
5 * All rights reserved.
6 *
7 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
8 *
9 * This driver replaces the following machine drivers:
10 * omap3beagle (Author: Steve Sakoman <steve@sakoman.com>)
11 * omap3evm (Author: Anuj Aggarwal <anuj.aggarwal@ti.com>)
12 * overo (Author: Steve Sakoman <steve@sakoman.com>)
13 * igep0020 (Author: Enric Balletbo i Serra <eballetbo@iseebcn.com>)
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * version 2 as published by the Free Software Foundation.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 * 02110-1301 USA
28 *
29 */
30
31#include <linux/platform_device.h>
32#include <linux/platform_data/omap-twl4030.h>
33#include <linux/module.h>
34#include <linux/of.h>
35
36#include <sound/core.h>
37#include <sound/pcm.h>
38#include <sound/soc.h>
39
40#include "omap-mcbsp.h"
41#include "omap-pcm.h"
42
43static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
44 struct snd_pcm_hw_params *params)
45{
46 struct snd_soc_pcm_runtime *rtd = substream->private_data;
47 struct snd_soc_dai *codec_dai = rtd->codec_dai;
48 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
49 struct snd_soc_codec *codec = rtd->codec;
50 struct snd_soc_card *card = codec->card;
51 unsigned int fmt;
52 int ret;
53
54 switch (params_channels(params)) {
55 case 2: /* Stereo I2S mode */
56 fmt = SND_SOC_DAIFMT_I2S |
57 SND_SOC_DAIFMT_NB_NF |
58 SND_SOC_DAIFMT_CBM_CFM;
59 break;
60 case 4: /* Four channel TDM mode */
61 fmt = SND_SOC_DAIFMT_DSP_A |
62 SND_SOC_DAIFMT_IB_NF |
63 SND_SOC_DAIFMT_CBM_CFM;
64 break;
65 default:
66 return -EINVAL;
67 }
68
69 /* Set codec DAI configuration */
70 ret = snd_soc_dai_set_fmt(codec_dai, fmt);
71 if (ret < 0) {
72 dev_err(card->dev, "can't set codec DAI configuration\n");
73 return ret;
74 }
75
76 /* Set cpu DAI configuration */
77 ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
78 if (ret < 0) {
79 dev_err(card->dev, "can't set cpu DAI configuration\n");
80 return ret;
81 }
82
83 return 0;
84}
85
86static struct snd_soc_ops omap_twl4030_ops = {
87 .hw_params = omap_twl4030_hw_params,
88};
89
90/* Digital audio interface glue - connects codec <--> CPU */
91static struct snd_soc_dai_link omap_twl4030_dai_links[] = {
92 {
93 .name = "TWL4030",
94 .stream_name = "TWL4030",
95 .cpu_dai_name = "omap-mcbsp.2",
96 .codec_dai_name = "twl4030-hifi",
97 .platform_name = "omap-pcm-audio",
98 .codec_name = "twl4030-codec",
99 .ops = &omap_twl4030_ops,
100 },
101};
102
103/* Audio machine driver */
104static struct snd_soc_card omap_twl4030_card = {
105 .owner = THIS_MODULE,
106 .dai_link = omap_twl4030_dai_links,
107 .num_links = ARRAY_SIZE(omap_twl4030_dai_links),
108};
109
110static __devinit int omap_twl4030_probe(struct platform_device *pdev)
111{
112 struct omap_tw4030_pdata *pdata = dev_get_platdata(&pdev->dev);
113 struct device_node *node = pdev->dev.of_node;
114 struct snd_soc_card *card = &omap_twl4030_card;
115 int ret = 0;
116
117 card->dev = &pdev->dev;
118
119 if (node) {
120 struct device_node *dai_node;
121
122 if (snd_soc_of_parse_card_name(card, "ti,model")) {
123 dev_err(&pdev->dev, "Card name is not provided\n");
124 return -ENODEV;
125 }
126
127 dai_node = of_parse_phandle(node, "ti,mcbsp", 0);
128 if (!dai_node) {
129 dev_err(&pdev->dev, "McBSP node is not provided\n");
130 return -EINVAL;
131 }
132 omap_twl4030_dai_links[0].cpu_dai_name = NULL;
133 omap_twl4030_dai_links[0].cpu_of_node = dai_node;
134
135 } else if (pdata) {
136 if (pdata->card_name) {
137 card->name = pdata->card_name;
138 } else {
139 dev_err(&pdev->dev, "Card name is not provided\n");
140 return -ENODEV;
141 }
142 } else {
143 dev_err(&pdev->dev, "Missing pdata\n");
144 return -ENODEV;
145 }
146
147 ret = snd_soc_register_card(card);
148 if (ret) {
149 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
150 ret);
151 return ret;
152 }
153
154 return 0;
155}
156
157static int __devexit omap_twl4030_remove(struct platform_device *pdev)
158{
159 struct snd_soc_card *card = platform_get_drvdata(pdev);
160
161 snd_soc_unregister_card(card);
162
163 return 0;
164}
165
166static const struct of_device_id omap_twl4030_of_match[] = {
167 {.compatible = "ti,omap-twl4030", },
168 { },
169};
170MODULE_DEVICE_TABLE(of, omap_twl4030_of_match);
171
172static struct platform_driver omap_twl4030_driver = {
173 .driver = {
174 .name = "omap-twl4030",
175 .owner = THIS_MODULE,
176 .pm = &snd_soc_pm_ops,
177 .of_match_table = omap_twl4030_of_match,
178 },
179 .probe = omap_twl4030_probe,
180 .remove = __devexit_p(omap_twl4030_remove),
181};
182
183module_platform_driver(omap_twl4030_driver);
184
185MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>");
186MODULE_DESCRIPTION("ALSA SoC for TI SoC based boards with twl4030 codec");
187MODULE_LICENSE("GPL");
188MODULE_ALIAS("platform:omap-twl4030");
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
deleted file mode 100644
index 2830dfd05661..000000000000
--- a/sound/soc/omap/omap3beagle.c
+++ /dev/null
@@ -1,150 +0,0 @@
1/*
2 * omap3beagle.c -- SoC audio for OMAP3 Beagle
3 *
4 * Author: Steve Sakoman <steve@sakoman.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <linux/clk.h>
23#include <linux/platform_device.h>
24#include <linux/module.h>
25#include <sound/core.h>
26#include <sound/pcm.h>
27#include <sound/soc.h>
28
29#include <asm/mach-types.h>
30#include <mach/hardware.h>
31#include <mach/gpio.h>
32#include <plat/mcbsp.h>
33
34#include "omap-mcbsp.h"
35#include "omap-pcm.h"
36
37static int omap3beagle_hw_params(struct snd_pcm_substream *substream,
38 struct snd_pcm_hw_params *params)
39{
40 struct snd_soc_pcm_runtime *rtd = substream->private_data;
41 struct snd_soc_dai *codec_dai = rtd->codec_dai;
42 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
43 unsigned int fmt;
44 int ret;
45
46 switch (params_channels(params)) {
47 case 2: /* Stereo I2S mode */
48 fmt = SND_SOC_DAIFMT_I2S |
49 SND_SOC_DAIFMT_NB_NF |
50 SND_SOC_DAIFMT_CBM_CFM;
51 break;
52 case 4: /* Four channel TDM mode */
53 fmt = SND_SOC_DAIFMT_DSP_A |
54 SND_SOC_DAIFMT_IB_NF |
55 SND_SOC_DAIFMT_CBM_CFM;
56 break;
57 default:
58 return -EINVAL;
59 }
60
61 /* Set codec DAI configuration */
62 ret = snd_soc_dai_set_fmt(codec_dai, fmt);
63 if (ret < 0) {
64 printk(KERN_ERR "can't set codec DAI configuration\n");
65 return ret;
66 }
67
68 /* Set cpu DAI configuration */
69 ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
70 if (ret < 0) {
71 printk(KERN_ERR "can't set cpu DAI configuration\n");
72 return ret;
73 }
74
75 /* Set the codec system clock for DAC and ADC */
76 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
77 SND_SOC_CLOCK_IN);
78 if (ret < 0) {
79 printk(KERN_ERR "can't set codec system clock\n");
80 return ret;
81 }
82
83 return 0;
84}
85
86static struct snd_soc_ops omap3beagle_ops = {
87 .hw_params = omap3beagle_hw_params,
88};
89
90/* Digital audio interface glue - connects codec <--> CPU */
91static struct snd_soc_dai_link omap3beagle_dai = {
92 .name = "TWL4030",
93 .stream_name = "TWL4030",
94 .cpu_dai_name = "omap-mcbsp.2",
95 .platform_name = "omap-pcm-audio",
96 .codec_dai_name = "twl4030-hifi",
97 .codec_name = "twl4030-codec",
98 .ops = &omap3beagle_ops,
99};
100
101/* Audio machine driver */
102static struct snd_soc_card snd_soc_omap3beagle = {
103 .name = "omap3beagle",
104 .owner = THIS_MODULE,
105 .dai_link = &omap3beagle_dai,
106 .num_links = 1,
107};
108
109static struct platform_device *omap3beagle_snd_device;
110
111static int __init omap3beagle_soc_init(void)
112{
113 int ret;
114
115 if (!(machine_is_omap3_beagle() || machine_is_devkit8000()))
116 return -ENODEV;
117 pr_info("OMAP3 Beagle/Devkit8000 SoC init\n");
118
119 omap3beagle_snd_device = platform_device_alloc("soc-audio", -1);
120 if (!omap3beagle_snd_device) {
121 printk(KERN_ERR "Platform device allocation failed\n");
122 return -ENOMEM;
123 }
124
125 platform_set_drvdata(omap3beagle_snd_device, &snd_soc_omap3beagle);
126
127 ret = platform_device_add(omap3beagle_snd_device);
128 if (ret)
129 goto err1;
130
131 return 0;
132
133err1:
134 printk(KERN_ERR "Unable to add platform device\n");
135 platform_device_put(omap3beagle_snd_device);
136
137 return ret;
138}
139
140static void __exit omap3beagle_soc_exit(void)
141{
142 platform_device_unregister(omap3beagle_snd_device);
143}
144
145module_init(omap3beagle_soc_init);
146module_exit(omap3beagle_soc_exit);
147
148MODULE_AUTHOR("Steve Sakoman <steve@sakoman.com>");
149MODULE_DESCRIPTION("ALSA SoC OMAP3 Beagle");
150MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
deleted file mode 100644
index 3d468c9179d7..000000000000
--- a/sound/soc/omap/omap3evm.c
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * omap3evm.c -- ALSA SoC support for OMAP3 EVM
3 *
4 * Author: Anuj Aggarwal <anuj.aggarwal@ti.com>
5 *
6 * Based on sound/soc/omap/beagle.c by Steve Sakoman
7 *
8 * Copyright (C) 2008 Texas Instruments, Incorporated
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation version 2.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 */
19
20#include <linux/clk.h>
21#include <linux/platform_device.h>
22#include <linux/module.h>
23#include <sound/core.h>
24#include <sound/pcm.h>
25#include <sound/soc.h>
26
27#include <asm/mach-types.h>
28#include <mach/hardware.h>
29#include <mach/gpio.h>
30#include <plat/mcbsp.h>
31
32#include "omap-mcbsp.h"
33#include "omap-pcm.h"
34
35static int omap3evm_hw_params(struct snd_pcm_substream *substream,
36 struct snd_pcm_hw_params *params)
37{
38 struct snd_soc_pcm_runtime *rtd = substream->private_data;
39 struct snd_soc_dai *codec_dai = rtd->codec_dai;
40 int ret;
41
42 /* Set the codec system clock for DAC and ADC */
43 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
44 SND_SOC_CLOCK_IN);
45 if (ret < 0) {
46 printk(KERN_ERR "Can't set codec system clock\n");
47 return ret;
48 }
49
50 return 0;
51}
52
53static struct snd_soc_ops omap3evm_ops = {
54 .hw_params = omap3evm_hw_params,
55};
56
57/* Digital audio interface glue - connects codec <--> CPU */
58static struct snd_soc_dai_link omap3evm_dai = {
59 .name = "TWL4030",
60 .stream_name = "TWL4030",
61 .cpu_dai_name = "omap-mcbsp.2",
62 .codec_dai_name = "twl4030-hifi",
63 .platform_name = "omap-pcm-audio",
64 .codec_name = "twl4030-codec",
65 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
66 SND_SOC_DAIFMT_CBM_CFM,
67 .ops = &omap3evm_ops,
68};
69
70/* Audio machine driver */
71static struct snd_soc_card snd_soc_omap3evm = {
72 .name = "omap3evm",
73 .owner = THIS_MODULE,
74 .dai_link = &omap3evm_dai,
75 .num_links = 1,
76};
77
78static struct platform_device *omap3evm_snd_device;
79
80static int __init omap3evm_soc_init(void)
81{
82 int ret;
83
84 if (!machine_is_omap3evm())
85 return -ENODEV;
86 pr_info("OMAP3 EVM SoC init\n");
87
88 omap3evm_snd_device = platform_device_alloc("soc-audio", -1);
89 if (!omap3evm_snd_device) {
90 printk(KERN_ERR "Platform device allocation failed\n");
91 return -ENOMEM;
92 }
93
94 platform_set_drvdata(omap3evm_snd_device, &snd_soc_omap3evm);
95 ret = platform_device_add(omap3evm_snd_device);
96 if (ret)
97 goto err1;
98
99 return 0;
100
101err1:
102 printk(KERN_ERR "Unable to add platform device\n");
103 platform_device_put(omap3evm_snd_device);
104
105 return ret;
106}
107
108static void __exit omap3evm_soc_exit(void)
109{
110 platform_device_unregister(omap3evm_snd_device);
111}
112
113module_init(omap3evm_soc_init);
114module_exit(omap3evm_soc_exit);
115
116MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>");
117MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM");
118MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c
deleted file mode 100644
index 6ac3e0c3c282..000000000000
--- a/sound/soc/omap/overo.c
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * overo.c -- SoC audio for Gumstix Overo
3 *
4 * Author: Steve Sakoman <steve@sakoman.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <linux/clk.h>
23#include <linux/platform_device.h>
24#include <linux/module.h>
25#include <sound/core.h>
26#include <sound/pcm.h>
27#include <sound/soc.h>
28
29#include <asm/mach-types.h>
30#include <mach/hardware.h>
31#include <mach/gpio.h>
32#include <plat/mcbsp.h>
33
34#include "omap-mcbsp.h"
35#include "omap-pcm.h"
36
37static int overo_hw_params(struct snd_pcm_substream *substream,
38 struct snd_pcm_hw_params *params)
39{
40 struct snd_soc_pcm_runtime *rtd = substream->private_data;
41 struct snd_soc_dai *codec_dai = rtd->codec_dai;
42 int ret;
43
44 /* Set the codec system clock for DAC and ADC */
45 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
46 SND_SOC_CLOCK_IN);
47 if (ret < 0) {
48 printk(KERN_ERR "can't set codec system clock\n");
49 return ret;
50 }
51
52 return 0;
53}
54
55static struct snd_soc_ops overo_ops = {
56 .hw_params = overo_hw_params,
57};
58
59/* Digital audio interface glue - connects codec <--> CPU */
60static struct snd_soc_dai_link overo_dai = {
61 .name = "TWL4030",
62 .stream_name = "TWL4030",
63 .cpu_dai_name = "omap-mcbsp.2",
64 .codec_dai_name = "twl4030-hifi",
65 .platform_name = "omap-pcm-audio",
66 .codec_name = "twl4030-codec",
67 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
68 SND_SOC_DAIFMT_CBM_CFM,
69 .ops = &overo_ops,
70};
71
72/* Audio machine driver */
73static struct snd_soc_card snd_soc_card_overo = {
74 .name = "overo",
75 .owner = THIS_MODULE,
76 .dai_link = &overo_dai,
77 .num_links = 1,
78};
79
80static struct platform_device *overo_snd_device;
81
82static int __init overo_soc_init(void)
83{
84 int ret;
85
86 if (!(machine_is_overo() || machine_is_cm_t35())) {
87 pr_debug("Incomatible machine!\n");
88 return -ENODEV;
89 }
90 printk(KERN_INFO "overo SoC init\n");
91
92 overo_snd_device = platform_device_alloc("soc-audio", -1);
93 if (!overo_snd_device) {
94 printk(KERN_ERR "Platform device allocation failed\n");
95 return -ENOMEM;
96 }
97
98 platform_set_drvdata(overo_snd_device, &snd_soc_card_overo);
99
100 ret = platform_device_add(overo_snd_device);
101 if (ret)
102 goto err1;
103
104 return 0;
105
106err1:
107 printk(KERN_ERR "Unable to add platform device\n");
108 platform_device_put(overo_snd_device);
109
110 return ret;
111}
112module_init(overo_soc_init);
113
114static void __exit overo_soc_exit(void)
115{
116 platform_device_unregister(overo_snd_device);
117}
118module_exit(overo_soc_exit);
119
120MODULE_AUTHOR("Steve Sakoman <steve@sakoman.com>");
121MODULE_DESCRIPTION("ALSA SoC overo");
122MODULE_LICENSE("GPL");