aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap2evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/omap2evm.c')
-rw-r--r--sound/soc/omap/omap2evm.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/sound/soc/omap/omap2evm.c b/sound/soc/omap/omap2evm.c
index c7adea38274c..cf3fc8a675b5 100644
--- a/sound/soc/omap/omap2evm.c
+++ b/sound/soc/omap/omap2evm.c
@@ -35,15 +35,13 @@
35 35
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
38#include "../codecs/twl4030.h"
39 38
40static int omap2evm_hw_params(struct snd_pcm_substream *substream, 39static int omap2evm_hw_params(struct snd_pcm_substream *substream,
41 struct snd_pcm_hw_params *params, 40 struct snd_pcm_hw_params *params)
42 struct snd_soc_dai *dai)
43{ 41{
44 struct snd_soc_pcm_runtime *rtd = substream->private_data; 42 struct snd_soc_pcm_runtime *rtd = substream->private_data;
45 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 43 struct snd_soc_dai *codec_dai = rtd->codec_dai;
46 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 44 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
47 int ret; 45 int ret;
48 46
49 /* Set codec DAI configuration */ 47 /* Set codec DAI configuration */
@@ -85,35 +83,28 @@ static struct snd_soc_ops omap2evm_ops = {
85static struct snd_soc_dai_link omap2evm_dai = { 83static struct snd_soc_dai_link omap2evm_dai = {
86 .name = "TWL4030", 84 .name = "TWL4030",
87 .stream_name = "TWL4030", 85 .stream_name = "TWL4030",
88 .cpu_dai = &omap_mcbsp_dai[0], 86 .cpu_dai_name = "omap-mcbsp-dai.1",
89 .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI], 87 .codec_dai_name = "twl4030-hifi",
88 .platform_name = "omap-pcm-audio",
89 .codec_name = "twl4030-codec",
90 .ops = &omap2evm_ops, 90 .ops = &omap2evm_ops,
91}; 91};
92 92
93/* Audio machine driver */ 93/* Audio machine driver */
94static struct snd_soc_card snd_soc_omap2evm = { 94static struct snd_soc_card snd_soc_omap2evm = {
95 .name = "omap2evm", 95 .name = "omap2evm",
96 .platform = &omap_soc_platform,
97 .dai_link = &omap2evm_dai, 96 .dai_link = &omap2evm_dai,
98 .num_links = 1, 97 .num_links = 1,
99}; 98};
100 99
101/* Audio subsystem */
102static struct snd_soc_device omap2evm_snd_devdata = {
103 .card = &snd_soc_omap2evm,
104 .codec_dev = &soc_codec_dev_twl4030,
105};
106
107static struct platform_device *omap2evm_snd_device; 100static struct platform_device *omap2evm_snd_device;
108 101
109static int __init omap2evm_soc_init(void) 102static int __init omap2evm_soc_init(void)
110{ 103{
111 int ret; 104 int ret;
112 105
113 if (!machine_is_omap2evm()) { 106 if (!machine_is_omap2evm())
114 pr_debug("Not omap2evm!\n");
115 return -ENODEV; 107 return -ENODEV;
116 }
117 printk(KERN_INFO "omap2evm SoC init\n"); 108 printk(KERN_INFO "omap2evm SoC init\n");
118 109
119 omap2evm_snd_device = platform_device_alloc("soc-audio", -1); 110 omap2evm_snd_device = platform_device_alloc("soc-audio", -1);
@@ -122,9 +113,7 @@ static int __init omap2evm_soc_init(void)
122 return -ENOMEM; 113 return -ENOMEM;
123 } 114 }
124 115
125 platform_set_drvdata(omap2evm_snd_device, &omap2evm_snd_devdata); 116 platform_set_drvdata(omap2evm_snd_device, &snd_soc_omap2evm);
126 omap2evm_snd_devdata.dev = &omap2evm_snd_device->dev;
127 *(unsigned int *)omap2evm_dai.cpu_dai->private_data = 1; /* McBSP2 */
128 117
129 ret = platform_device_add(omap2evm_snd_device); 118 ret = platform_device_add(omap2evm_snd_device);
130 if (ret) 119 if (ret)