diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-08-14 05:07:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-15 12:10:00 -0400 |
commit | 152c6e56f6a8577bd291f6f4ca897e5758332a1b (patch) | |
tree | 6cf3aa4cd95f3e943a5ccd562cf2222a20920488 /sound/soc/omap | |
parent | ac51c90f10be1d1e360f50ca521e3a2133919d23 (diff) |
ASoC: Remove obsolete OMAP3 machine drivers
The new omap-twl4030 handles the boards used the following drivers:
igep0020, omap3beagle, omap3evm and overo.
Remove these drivers since they are mostly identical and we already have
drop in replacement for all of them.
Note: Earlier patch added the needed code for the board files to retain the
audio support for boards I can identify that used one of the removed
drivers.
If I missed something please take a look at for example:
arch/arm/mach-omap2/board-omap3beagle.c on how add support for omap-twl4030
audio.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/Kconfig | 35 | ||||
-rw-r--r-- | sound/soc/omap/Makefile | 8 | ||||
-rw-r--r-- | sound/soc/omap/igep0020.c | 120 | ||||
-rw-r--r-- | sound/soc/omap/omap3beagle.c | 150 | ||||
-rw-r--r-- | sound/soc/omap/omap3evm.c | 118 | ||||
-rw-r--r-- | sound/soc/omap/overo.c | 122 |
6 files changed, 0 insertions, 553 deletions
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index fc83d748625f..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 | ||
63 | config 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 | |||
72 | config 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 | |||
80 | config SND_OMAP_SOC_AM3517EVM | 63 | config 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 |
@@ -140,16 +123,6 @@ config SND_OMAP_SOC_OMAP3_PANDORA | |||
140 | help | 123 | help |
141 | 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. |
142 | 125 | ||
143 | config SND_OMAP_SOC_OMAP3_BEAGLE | ||
144 | tristate "SoC Audio support for OMAP3 Beagle and Devkit8000" | ||
145 | depends on TWL4030_CORE && SND_OMAP_SOC | ||
146 | depends on (MACH_OMAP3_BEAGLE || MACH_DEVKIT8000) | ||
147 | select SND_OMAP_SOC_MCBSP | ||
148 | select SND_SOC_TWL4030 | ||
149 | help | ||
150 | Say Y if you want to add support for SoC audio on the Beagleboard or | ||
151 | the clone Devkit8000. | ||
152 | |||
153 | config SND_OMAP_SOC_ZOOM2 | 126 | config SND_OMAP_SOC_ZOOM2 |
154 | tristate "SoC Audio support for Zoom2" | 127 | tristate "SoC Audio support for Zoom2" |
155 | depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2 | 128 | depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2 |
@@ -157,11 +130,3 @@ config SND_OMAP_SOC_ZOOM2 | |||
157 | select SND_SOC_TWL4030 | 130 | select SND_SOC_TWL4030 |
158 | help | 131 | help |
159 | 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. |
160 | |||
161 | config SND_OMAP_SOC_IGEP0020 | ||
162 | tristate "SoC Audio support for IGEP v2" | ||
163 | depends on TWL4030_CORE && SND_OMAP_SOC && MACH_IGEP0020 | ||
164 | select SND_OMAP_SOC_MCBSP | ||
165 | select SND_SOC_TWL4030 | ||
166 | help | ||
167 | 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 861e640e2be9..19637e55ea48 100644 --- a/sound/soc/omap/Makefile +++ b/sound/soc/omap/Makefile | |||
@@ -16,31 +16,23 @@ snd-soc-n810-objs := n810.o | |||
16 | snd-soc-rx51-objs := rx51.o | 16 | snd-soc-rx51-objs := rx51.o |
17 | snd-soc-ams-delta-objs := ams-delta.o | 17 | snd-soc-ams-delta-objs := ams-delta.o |
18 | snd-soc-osk5912-objs := osk5912.o | 18 | snd-soc-osk5912-objs := osk5912.o |
19 | snd-soc-overo-objs := overo.o | ||
20 | snd-soc-omap3evm-objs := omap3evm.o | ||
21 | snd-soc-am3517evm-objs := am3517evm.o | 19 | snd-soc-am3517evm-objs := am3517evm.o |
22 | snd-soc-sdp3430-objs := sdp3430.o | 20 | snd-soc-sdp3430-objs := sdp3430.o |
23 | snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o | 21 | snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o |
24 | snd-soc-omap-twl4030-objs := omap-twl4030.o | 22 | snd-soc-omap-twl4030-objs := omap-twl4030.o |
25 | snd-soc-omap3pandora-objs := omap3pandora.o | 23 | snd-soc-omap3pandora-objs := omap3pandora.o |
26 | snd-soc-omap3beagle-objs := omap3beagle.o | ||
27 | snd-soc-zoom2-objs := zoom2.o | 24 | snd-soc-zoom2-objs := zoom2.o |
28 | snd-soc-igep0020-objs := igep0020.o | ||
29 | snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o | 25 | snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o |
30 | 26 | ||
31 | obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o | 27 | obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o |
32 | obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o | 28 | obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o |
33 | obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA) += snd-soc-ams-delta.o | 29 | obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA) += snd-soc-ams-delta.o |
34 | obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o | 30 | obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o |
35 | obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o | ||
36 | obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o | 31 | obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o |
37 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o | ||
38 | obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o | 32 | obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o |
39 | obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o | 33 | obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o |
40 | obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o | 34 | obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o |
41 | obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o | 35 | obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o |
42 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o | 36 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o |
43 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o | ||
44 | obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o | 37 | obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o |
45 | obj-$(CONFIG_SND_OMAP_SOC_IGEP0020) += snd-soc-igep0020.o | ||
46 | obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o | 38 | obj-$(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 | |||
37 | static 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 | |||
55 | static struct snd_soc_ops igep2_ops = { | ||
56 | .hw_params = igep2_hw_params, | ||
57 | }; | ||
58 | |||
59 | /* Digital audio interface glue - connects codec <--> CPU */ | ||
60 | static 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 */ | ||
73 | static 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 | |||
80 | static struct platform_device *igep2_snd_device; | ||
81 | |||
82 | static 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 | |||
104 | err1: | ||
105 | printk(KERN_ERR "Unable to add platform device\n"); | ||
106 | platform_device_put(igep2_snd_device); | ||
107 | |||
108 | return ret; | ||
109 | } | ||
110 | module_init(igep2_soc_init); | ||
111 | |||
112 | static void __exit igep2_soc_exit(void) | ||
113 | { | ||
114 | platform_device_unregister(igep2_snd_device); | ||
115 | } | ||
116 | module_exit(igep2_soc_exit); | ||
117 | |||
118 | MODULE_AUTHOR("Enric Balletbo i Serra <eballetbo@iseebcn.com>"); | ||
119 | MODULE_DESCRIPTION("ALSA SoC IGEP v2"); | ||
120 | MODULE_LICENSE("GPL"); | ||
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 | |||
37 | static 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 | |||
86 | static struct snd_soc_ops omap3beagle_ops = { | ||
87 | .hw_params = omap3beagle_hw_params, | ||
88 | }; | ||
89 | |||
90 | /* Digital audio interface glue - connects codec <--> CPU */ | ||
91 | static 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 */ | ||
102 | static 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 | |||
109 | static struct platform_device *omap3beagle_snd_device; | ||
110 | |||
111 | static 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 | |||
133 | err1: | ||
134 | printk(KERN_ERR "Unable to add platform device\n"); | ||
135 | platform_device_put(omap3beagle_snd_device); | ||
136 | |||
137 | return ret; | ||
138 | } | ||
139 | |||
140 | static void __exit omap3beagle_soc_exit(void) | ||
141 | { | ||
142 | platform_device_unregister(omap3beagle_snd_device); | ||
143 | } | ||
144 | |||
145 | module_init(omap3beagle_soc_init); | ||
146 | module_exit(omap3beagle_soc_exit); | ||
147 | |||
148 | MODULE_AUTHOR("Steve Sakoman <steve@sakoman.com>"); | ||
149 | MODULE_DESCRIPTION("ALSA SoC OMAP3 Beagle"); | ||
150 | MODULE_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 | |||
35 | static 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 | |||
53 | static struct snd_soc_ops omap3evm_ops = { | ||
54 | .hw_params = omap3evm_hw_params, | ||
55 | }; | ||
56 | |||
57 | /* Digital audio interface glue - connects codec <--> CPU */ | ||
58 | static 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 */ | ||
71 | static 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 | |||
78 | static struct platform_device *omap3evm_snd_device; | ||
79 | |||
80 | static 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 | |||
101 | err1: | ||
102 | printk(KERN_ERR "Unable to add platform device\n"); | ||
103 | platform_device_put(omap3evm_snd_device); | ||
104 | |||
105 | return ret; | ||
106 | } | ||
107 | |||
108 | static void __exit omap3evm_soc_exit(void) | ||
109 | { | ||
110 | platform_device_unregister(omap3evm_snd_device); | ||
111 | } | ||
112 | |||
113 | module_init(omap3evm_soc_init); | ||
114 | module_exit(omap3evm_soc_exit); | ||
115 | |||
116 | MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>"); | ||
117 | MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM"); | ||
118 | MODULE_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 | |||
37 | static 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 | |||
55 | static struct snd_soc_ops overo_ops = { | ||
56 | .hw_params = overo_hw_params, | ||
57 | }; | ||
58 | |||
59 | /* Digital audio interface glue - connects codec <--> CPU */ | ||
60 | static 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 */ | ||
73 | static 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 | |||
80 | static struct platform_device *overo_snd_device; | ||
81 | |||
82 | static 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 | |||
106 | err1: | ||
107 | printk(KERN_ERR "Unable to add platform device\n"); | ||
108 | platform_device_put(overo_snd_device); | ||
109 | |||
110 | return ret; | ||
111 | } | ||
112 | module_init(overo_soc_init); | ||
113 | |||
114 | static void __exit overo_soc_exit(void) | ||
115 | { | ||
116 | platform_device_unregister(overo_snd_device); | ||
117 | } | ||
118 | module_exit(overo_soc_exit); | ||
119 | |||
120 | MODULE_AUTHOR("Steve Sakoman <steve@sakoman.com>"); | ||
121 | MODULE_DESCRIPTION("ALSA SoC overo"); | ||
122 | MODULE_LICENSE("GPL"); | ||