aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap3evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/omap3evm.c')
-rw-r--r--sound/soc/omap/omap3evm.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
index dfcb344092e4..810f1e36da21 100644
--- a/sound/soc/omap/omap3evm.c
+++ b/sound/soc/omap/omap3evm.c
@@ -31,14 +31,13 @@
31 31
32#include "omap-mcbsp.h" 32#include "omap-mcbsp.h"
33#include "omap-pcm.h" 33#include "omap-pcm.h"
34#include "../codecs/twl4030.h"
35 34
36static int omap3evm_hw_params(struct snd_pcm_substream *substream, 35static int omap3evm_hw_params(struct snd_pcm_substream *substream,
37 struct snd_pcm_hw_params *params) 36 struct snd_pcm_hw_params *params)
38{ 37{
39 struct snd_soc_pcm_runtime *rtd = substream->private_data; 38 struct snd_soc_pcm_runtime *rtd = substream->private_data;
40 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 39 struct snd_soc_dai *codec_dai = rtd->codec_dai;
41 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 40 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
42 int ret; 41 int ret;
43 42
44 /* Set codec DAI configuration */ 43 /* Set codec DAI configuration */
@@ -80,42 +79,28 @@ static struct snd_soc_ops omap3evm_ops = {
80static struct snd_soc_dai_link omap3evm_dai = { 79static struct snd_soc_dai_link omap3evm_dai = {
81 .name = "TWL4030", 80 .name = "TWL4030",
82 .stream_name = "TWL4030", 81 .stream_name = "TWL4030",
83 .cpu_dai = &omap_mcbsp_dai[0], 82 .cpu_dai_name = "omap-mcbsp-dai.1",
84 .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI], 83 .codec_dai_name = "twl4030-hifi",
84 .platform_name = "omap-pcm-audio",
85 .codec_name = "twl4030-codec",
85 .ops = &omap3evm_ops, 86 .ops = &omap3evm_ops,
86}; 87};
87 88
88/* Audio machine driver */ 89/* Audio machine driver */
89static struct snd_soc_card snd_soc_omap3evm = { 90static struct snd_soc_card snd_soc_omap3evm = {
90 .name = "omap3evm", 91 .name = "omap3evm",
91 .platform = &omap_soc_platform,
92 .dai_link = &omap3evm_dai, 92 .dai_link = &omap3evm_dai,
93 .num_links = 1, 93 .num_links = 1,
94}; 94};
95 95
96/* twl4030 setup */
97static struct twl4030_setup_data twl4030_setup = {
98 .ramp_delay_value = 4,
99 .sysclk = 26000,
100};
101
102/* Audio subsystem */
103static struct snd_soc_device omap3evm_snd_devdata = {
104 .card = &snd_soc_omap3evm,
105 .codec_dev = &soc_codec_dev_twl4030,
106 .codec_data = &twl4030_setup,
107};
108
109static struct platform_device *omap3evm_snd_device; 96static struct platform_device *omap3evm_snd_device;
110 97
111static int __init omap3evm_soc_init(void) 98static int __init omap3evm_soc_init(void)
112{ 99{
113 int ret; 100 int ret;
114 101
115 if (!machine_is_omap3evm()) { 102 if (!machine_is_omap3evm())
116 pr_err("Not OMAP3 EVM!\n");
117 return -ENODEV; 103 return -ENODEV;
118 }
119 pr_info("OMAP3 EVM SoC init\n"); 104 pr_info("OMAP3 EVM SoC init\n");
120 105
121 omap3evm_snd_device = platform_device_alloc("soc-audio", -1); 106 omap3evm_snd_device = platform_device_alloc("soc-audio", -1);
@@ -124,10 +109,7 @@ static int __init omap3evm_soc_init(void)
124 return -ENOMEM; 109 return -ENOMEM;
125 } 110 }
126 111
127 platform_set_drvdata(omap3evm_snd_device, &omap3evm_snd_devdata); 112 platform_set_drvdata(omap3evm_snd_device, &snd_soc_omap3evm);
128 omap3evm_snd_devdata.dev = &omap3evm_snd_device->dev;
129 *(unsigned int *)omap3evm_dai.cpu_dai->private_data = 1;
130
131 ret = platform_device_add(omap3evm_snd_device); 113 ret = platform_device_add(omap3evm_snd_device);
132 if (ret) 114 if (ret)
133 goto err1; 115 goto err1;