aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-12-31 05:51:49 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-02 08:04:25 -0500
commit57d61b9d2d7bc618b7b28a46310d9c2f086f8f51 (patch)
tree1e6a43bf0b2d318195fd545ac8b426460533e45c
parentbd0b286e838ef1ca19bbe1cb55f0ec7e0135de1f (diff)
ASoC: OMAP: Remove obsolete machine drivers for Zoom2 and SDP3430
These boards are using the common omap-twl4030 machine driver, no need for separate machine drivers anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/omap/Kconfig17
-rw-r--r--sound/soc/omap/Makefile4
-rw-r--r--sound/soc/omap/sdp3430.c245
-rw-r--r--sound/soc/omap/zoom2.c193
4 files changed, 0 insertions, 459 deletions
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index e8d2a2f983b5..60259f2f3f2c 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -70,15 +70,6 @@ config SND_OMAP_SOC_AM3517EVM
70 Say Y if you want to add support for SoC audio on the OMAP3517 / AM3517 70 Say Y if you want to add support for SoC audio on the OMAP3517 / AM3517
71 EVM. 71 EVM.
72 72
73config SND_OMAP_SOC_SDP3430
74 tristate "SoC Audio support for Texas Instruments SDP3430"
75 depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_3430SDP
76 select SND_OMAP_SOC_MCBSP
77 select SND_SOC_TWL4030
78 help
79 Say Y if you want to add support for SoC audio on Texas Instruments
80 SDP3430.
81
82config SND_OMAP_SOC_OMAP_TWL4030 73config SND_OMAP_SOC_OMAP_TWL4030
83 tristate "SoC Audio support for TI SoC based boards with twl4030 codec" 74 tristate "SoC Audio support for TI SoC based boards with twl4030 codec"
84 depends on TWL4030_CORE && SND_OMAP_SOC 75 depends on TWL4030_CORE && SND_OMAP_SOC
@@ -125,11 +116,3 @@ config SND_OMAP_SOC_OMAP3_PANDORA
125 select SND_SOC_TWL4030 116 select SND_SOC_TWL4030
126 help 117 help
127 Say Y if you want to add support for SoC audio on the OMAP3 Pandora. 118 Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
128
129config SND_OMAP_SOC_ZOOM2
130 tristate "SoC Audio support for Zoom2"
131 depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2
132 select SND_OMAP_SOC_MCBSP
133 select SND_SOC_TWL4030
134 help
135 Say Y if you want to add support for Soc audio on Zoom2 board.
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 19637e55ea48..2b225945359b 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -17,11 +17,9 @@ snd-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-am3517evm-objs := am3517evm.o 19snd-soc-am3517evm-objs := am3517evm.o
20snd-soc-sdp3430-objs := sdp3430.o
21snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o 20snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
22snd-soc-omap-twl4030-objs := omap-twl4030.o 21snd-soc-omap-twl4030-objs := omap-twl4030.o
23snd-soc-omap3pandora-objs := omap3pandora.o 22snd-soc-omap3pandora-objs := omap3pandora.o
24snd-soc-zoom2-objs := zoom2.o
25snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o 23snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o
26 24
27obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o 25obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
@@ -30,9 +28,7 @@ obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA) += snd-soc-ams-delta.o
30obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o 28obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
31obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o 29obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o
32obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o 30obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
33obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
34obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o 31obj-$(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 32obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o
36obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o 33obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
37obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
38obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o 34obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
deleted file mode 100644
index 216cbdd569e7..000000000000
--- a/sound/soc/omap/sdp3430.c
+++ /dev/null
@@ -1,245 +0,0 @@
1/*
2 * sdp3430.c -- SoC audio for TI OMAP3430 SDP
3 *
4 * Author: Misael Lopez Cruz <x0052729@ti.com>
5 *
6 * Based on:
7 * Author: Steve Sakoman <steve@sakoman.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#include <linux/clk.h>
26#include <linux/platform_device.h>
27#include <sound/core.h>
28#include <sound/pcm.h>
29#include <sound/soc.h>
30#include <sound/jack.h>
31
32#include <asm/mach-types.h>
33#include <linux/platform_data/gpio-omap.h>
34
35#include <linux/module.h>
36
37#include "omap-mcbsp.h"
38#include "omap-pcm.h"
39
40static struct snd_soc_card snd_soc_sdp3430;
41
42static int sdp3430_hw_params(struct snd_pcm_substream *substream,
43 struct snd_pcm_hw_params *params)
44{
45 struct snd_soc_pcm_runtime *rtd = substream->private_data;
46 struct snd_soc_dai *codec_dai = rtd->codec_dai;
47 int ret;
48
49 /* Set the codec system clock for DAC and ADC */
50 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
51 SND_SOC_CLOCK_IN);
52 if (ret < 0) {
53 printk(KERN_ERR "can't set codec system clock\n");
54 return ret;
55 }
56
57 return 0;
58}
59
60static struct snd_soc_ops sdp3430_ops = {
61 .hw_params = sdp3430_hw_params,
62};
63
64/* Headset jack */
65static struct snd_soc_jack hs_jack;
66
67/* Headset jack detection DAPM pins */
68static struct snd_soc_jack_pin hs_jack_pins[] = {
69 {
70 .pin = "Headset Mic",
71 .mask = SND_JACK_MICROPHONE,
72 },
73 {
74 .pin = "Headset Stereophone",
75 .mask = SND_JACK_HEADPHONE,
76 },
77};
78
79/* Headset jack detection gpios */
80static struct snd_soc_jack_gpio hs_jack_gpios[] = {
81 {
82 .gpio = (OMAP_MAX_GPIO_LINES + 2),
83 .name = "hsdet-gpio",
84 .report = SND_JACK_HEADSET,
85 .debounce_time = 200,
86 },
87};
88
89/* SDP3430 machine DAPM */
90static const struct snd_soc_dapm_widget sdp3430_twl4030_dapm_widgets[] = {
91 SND_SOC_DAPM_MIC("Ext Mic", NULL),
92 SND_SOC_DAPM_SPK("Ext Spk", NULL),
93 SND_SOC_DAPM_MIC("Headset Mic", NULL),
94 SND_SOC_DAPM_HP("Headset Stereophone", NULL),
95};
96
97static const struct snd_soc_dapm_route audio_map[] = {
98 /* External Mics: MAINMIC, SUBMIC with bias */
99 {"MAINMIC", NULL, "Ext Mic"},
100 {"SUBMIC", NULL, "Ext Mic"},
101 {"Ext Mic", NULL, "Mic Bias 1"},
102 {"Ext Mic", NULL, "Mic Bias 2"},
103
104 /* External Speakers: HFL, HFR */
105 {"Ext Spk", NULL, "HFL"},
106 {"Ext Spk", NULL, "HFR"},
107
108 /* Headset Mic: HSMIC with bias */
109 {"HSMIC", NULL, "Headset Mic"},
110 {"Headset Mic", NULL, "Headset Mic Bias"},
111
112 /* Headset Stereophone (Headphone): HSOL, HSOR */
113 {"Headset Stereophone", NULL, "HSOL"},
114 {"Headset Stereophone", NULL, "HSOR"},
115};
116
117static int sdp3430_twl4030_init(struct snd_soc_pcm_runtime *rtd)
118{
119 struct snd_soc_codec *codec = rtd->codec;
120 struct snd_soc_dapm_context *dapm = &codec->dapm;
121 int ret;
122
123 /* SDP3430 connected pins */
124 snd_soc_dapm_enable_pin(dapm, "Ext Mic");
125 snd_soc_dapm_enable_pin(dapm, "Ext Spk");
126 snd_soc_dapm_disable_pin(dapm, "Headset Mic");
127 snd_soc_dapm_disable_pin(dapm, "Headset Stereophone");
128
129 /* TWL4030 not connected pins */
130 snd_soc_dapm_nc_pin(dapm, "AUXL");
131 snd_soc_dapm_nc_pin(dapm, "AUXR");
132 snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
133 snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
134 snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");
135
136 snd_soc_dapm_nc_pin(dapm, "OUTL");
137 snd_soc_dapm_nc_pin(dapm, "OUTR");
138 snd_soc_dapm_nc_pin(dapm, "EARPIECE");
139 snd_soc_dapm_nc_pin(dapm, "PREDRIVEL");
140 snd_soc_dapm_nc_pin(dapm, "PREDRIVER");
141 snd_soc_dapm_nc_pin(dapm, "CARKITL");
142 snd_soc_dapm_nc_pin(dapm, "CARKITR");
143
144 /* Headset jack detection */
145 ret = snd_soc_jack_new(codec, "Headset Jack",
146 SND_JACK_HEADSET, &hs_jack);
147 if (ret)
148 return ret;
149
150 ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
151 hs_jack_pins);
152 if (ret)
153 return ret;
154
155 ret = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
156 hs_jack_gpios);
157
158 return ret;
159}
160
161/* Digital audio interface glue - connects codec <--> CPU */
162static struct snd_soc_dai_link sdp3430_dai[] = {
163 {
164 .name = "TWL4030 I2S",
165 .stream_name = "TWL4030 Audio",
166 .cpu_dai_name = "omap-mcbsp.2",
167 .codec_dai_name = "twl4030-hifi",
168 .platform_name = "omap-pcm-audio",
169 .codec_name = "twl4030-codec",
170 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
171 SND_SOC_DAIFMT_CBM_CFM,
172 .init = sdp3430_twl4030_init,
173 .ops = &sdp3430_ops,
174 },
175 {
176 .name = "TWL4030 PCM",
177 .stream_name = "TWL4030 Voice",
178 .cpu_dai_name = "omap-mcbsp.3",
179 .codec_dai_name = "twl4030-voice",
180 .platform_name = "omap-pcm-audio",
181 .codec_name = "twl4030-codec",
182 .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF |
183 SND_SOC_DAIFMT_CBM_CFM,
184 .ops = &sdp3430_ops,
185 },
186};
187
188/* Audio machine driver */
189static struct snd_soc_card snd_soc_sdp3430 = {
190 .name = "SDP3430",
191 .owner = THIS_MODULE,
192 .dai_link = sdp3430_dai,
193 .num_links = ARRAY_SIZE(sdp3430_dai),
194
195 .dapm_widgets = sdp3430_twl4030_dapm_widgets,
196 .num_dapm_widgets = ARRAY_SIZE(sdp3430_twl4030_dapm_widgets),
197 .dapm_routes = audio_map,
198 .num_dapm_routes = ARRAY_SIZE(audio_map),
199};
200
201static struct platform_device *sdp3430_snd_device;
202
203static int __init sdp3430_soc_init(void)
204{
205 int ret;
206
207 if (!machine_is_omap_3430sdp())
208 return -ENODEV;
209 printk(KERN_INFO "SDP3430 SoC init\n");
210
211 sdp3430_snd_device = platform_device_alloc("soc-audio", -1);
212 if (!sdp3430_snd_device) {
213 printk(KERN_ERR "Platform device allocation failed\n");
214 return -ENOMEM;
215 }
216
217 platform_set_drvdata(sdp3430_snd_device, &snd_soc_sdp3430);
218
219 ret = platform_device_add(sdp3430_snd_device);
220 if (ret)
221 goto err1;
222
223 return 0;
224
225err1:
226 printk(KERN_ERR "Unable to add platform device\n");
227 platform_device_put(sdp3430_snd_device);
228
229 return ret;
230}
231module_init(sdp3430_soc_init);
232
233static void __exit sdp3430_soc_exit(void)
234{
235 snd_soc_jack_free_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
236 hs_jack_gpios);
237
238 platform_device_unregister(sdp3430_snd_device);
239}
240module_exit(sdp3430_soc_exit);
241
242MODULE_AUTHOR("Misael Lopez Cruz <x0052729@ti.com>");
243MODULE_DESCRIPTION("ALSA SoC SDP3430");
244MODULE_LICENSE("GPL");
245
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
deleted file mode 100644
index 62a6b02d9b36..000000000000
--- a/sound/soc/omap/zoom2.c
+++ /dev/null
@@ -1,193 +0,0 @@
1/*
2 * zoom2.c -- SoC audio for Zoom2
3 *
4 * Author: Misael Lopez Cruz <x0052729@ti.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/gpio.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 <linux/platform_data/asoc-ti-mcbsp.h>
31#include <linux/platform_data/gpio-omap.h>
32
33/* Register descriptions for twl4030 codec part */
34#include <linux/mfd/twl4030-audio.h>
35#include <linux/module.h>
36
37#include "omap-mcbsp.h"
38#include "omap-pcm.h"
39
40static int zoom2_hw_params(struct snd_pcm_substream *substream,
41 struct snd_pcm_hw_params *params)
42{
43 struct snd_soc_pcm_runtime *rtd = substream->private_data;
44 struct snd_soc_dai *codec_dai = rtd->codec_dai;
45 int ret;
46
47 /* Set the codec system clock for DAC and ADC */
48 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
49 SND_SOC_CLOCK_IN);
50 if (ret < 0) {
51 printk(KERN_ERR "can't set codec system clock\n");
52 return ret;
53 }
54
55 return 0;
56}
57
58static struct snd_soc_ops zoom2_ops = {
59 .hw_params = zoom2_hw_params,
60};
61
62/* Zoom2 machine DAPM */
63static const struct snd_soc_dapm_widget zoom2_twl4030_dapm_widgets[] = {
64 SND_SOC_DAPM_MIC("Ext Mic", NULL),
65 SND_SOC_DAPM_SPK("Ext Spk", NULL),
66 SND_SOC_DAPM_MIC("Headset Mic", NULL),
67 SND_SOC_DAPM_HP("Headset Stereophone", NULL),
68 SND_SOC_DAPM_LINE("Aux In", NULL),
69};
70
71static const struct snd_soc_dapm_route audio_map[] = {
72 /* External Mics: MAINMIC, SUBMIC with bias */
73 {"MAINMIC", NULL, "Ext Mic"},
74 {"SUBMIC", NULL, "Ext Mic"},
75 {"Ext Mic", NULL, "Mic Bias 1"},
76 {"Ext Mic", NULL, "Mic Bias 2"},
77
78 /* External Speakers: HFL, HFR */
79 {"Ext Spk", NULL, "HFL"},
80 {"Ext Spk", NULL, "HFR"},
81
82 /* Headset Stereophone: HSOL, HSOR */
83 {"Headset Stereophone", NULL, "HSOL"},
84 {"Headset Stereophone", NULL, "HSOR"},
85
86 /* Headset Mic: HSMIC with bias */
87 {"HSMIC", NULL, "Headset Mic"},
88 {"Headset Mic", NULL, "Headset Mic Bias"},
89
90 /* Aux In: AUXL, AUXR */
91 {"Aux In", NULL, "AUXL"},
92 {"Aux In", NULL, "AUXR"},
93};
94
95static int zoom2_twl4030_init(struct snd_soc_pcm_runtime *rtd)
96{
97 struct snd_soc_codec *codec = rtd->codec;
98 struct snd_soc_dapm_context *dapm = &codec->dapm;
99
100 /* TWL4030 not connected pins */
101 snd_soc_dapm_nc_pin(dapm, "CARKITMIC");
102 snd_soc_dapm_nc_pin(dapm, "DIGIMIC0");
103 snd_soc_dapm_nc_pin(dapm, "DIGIMIC1");
104 snd_soc_dapm_nc_pin(dapm, "EARPIECE");
105 snd_soc_dapm_nc_pin(dapm, "PREDRIVEL");
106 snd_soc_dapm_nc_pin(dapm, "PREDRIVER");
107 snd_soc_dapm_nc_pin(dapm, "CARKITL");
108 snd_soc_dapm_nc_pin(dapm, "CARKITR");
109
110 return 0;
111}
112
113/* Digital audio interface glue - connects codec <--> CPU */
114static struct snd_soc_dai_link zoom2_dai[] = {
115 {
116 .name = "TWL4030 I2S",
117 .stream_name = "TWL4030 Audio",
118 .cpu_dai_name = "omap-mcbsp.2",
119 .codec_dai_name = "twl4030-hifi",
120 .platform_name = "omap-pcm-audio",
121 .codec_name = "twl4030-codec",
122 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
123 SND_SOC_DAIFMT_CBM_CFM,
124 .init = zoom2_twl4030_init,
125 .ops = &zoom2_ops,
126 },
127 {
128 .name = "TWL4030 PCM",
129 .stream_name = "TWL4030 Voice",
130 .cpu_dai_name = "omap-mcbsp.3",
131 .codec_dai_name = "twl4030-voice",
132 .platform_name = "omap-pcm-audio",
133 .codec_name = "twl4030-codec",
134 .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF |
135 SND_SOC_DAIFMT_CBM_CFM,
136 .ops = &zoom2_ops,
137 },
138};
139
140/* Audio machine driver */
141static struct snd_soc_card snd_soc_zoom2 = {
142 .name = "Zoom2",
143 .owner = THIS_MODULE,
144 .dai_link = zoom2_dai,
145 .num_links = ARRAY_SIZE(zoom2_dai),
146
147 .dapm_widgets = zoom2_twl4030_dapm_widgets,
148 .num_dapm_widgets = ARRAY_SIZE(zoom2_twl4030_dapm_widgets),
149 .dapm_routes = audio_map,
150 .num_dapm_routes = ARRAY_SIZE(audio_map),
151};
152
153static struct platform_device *zoom2_snd_device;
154
155static int __init zoom2_soc_init(void)
156{
157 int ret;
158
159 if (!machine_is_omap_zoom2())
160 return -ENODEV;
161 printk(KERN_INFO "Zoom2 SoC init\n");
162
163 zoom2_snd_device = platform_device_alloc("soc-audio", -1);
164 if (!zoom2_snd_device) {
165 printk(KERN_ERR "Platform device allocation failed\n");
166 return -ENOMEM;
167 }
168
169 platform_set_drvdata(zoom2_snd_device, &snd_soc_zoom2);
170 ret = platform_device_add(zoom2_snd_device);
171 if (ret)
172 goto err1;
173
174 return 0;
175
176err1:
177 printk(KERN_ERR "Unable to add platform device\n");
178 platform_device_put(zoom2_snd_device);
179
180 return ret;
181}
182module_init(zoom2_soc_init);
183
184static void __exit zoom2_soc_exit(void)
185{
186 platform_device_unregister(zoom2_snd_device);
187}
188module_exit(zoom2_soc_exit);
189
190MODULE_AUTHOR("Misael Lopez Cruz <x0052729@ti.com>");
191MODULE_DESCRIPTION("ALSA SoC Zoom2");
192MODULE_LICENSE("GPL");
193