aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/sdp4430.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/sdp4430.c')
-rw-r--r--sound/soc/omap/sdp4430.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 4ebbde6b565f..4b4463db6ba0 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -31,7 +31,6 @@
31#include <plat/mux.h> 31#include <plat/mux.h>
32 32
33#include "mcpdm.h" 33#include "mcpdm.h"
34#include "omap-mcpdm.h"
35#include "omap-pcm.h" 34#include "omap-pcm.h"
36#include "../codecs/twl6040.h" 35#include "../codecs/twl6040.h"
37 36
@@ -41,7 +40,7 @@ static int sdp4430_hw_params(struct snd_pcm_substream *substream,
41 struct snd_pcm_hw_params *params) 40 struct snd_pcm_hw_params *params)
42{ 41{
43 struct snd_soc_pcm_runtime *rtd = substream->private_data; 42 struct snd_soc_pcm_runtime *rtd = substream->private_data;
44 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 43 struct snd_soc_dai *codec_dai = rtd->codec_dai;
45 int clk_id, freq; 44 int clk_id, freq;
46 int ret; 45 int ret;
47 46
@@ -60,6 +59,7 @@ static int sdp4430_hw_params(struct snd_pcm_substream *substream,
60 printk(KERN_ERR "can't set codec system clock\n"); 59 printk(KERN_ERR "can't set codec system clock\n");
61 return ret; 60 return ret;
62 } 61 }
62 return ret;
63} 63}
64 64
65static struct snd_soc_ops sdp4430_ops = { 65static struct snd_soc_ops sdp4430_ops = {
@@ -126,8 +126,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
126 {"Earphone Spk", NULL, "EP"}, 126 {"Earphone Spk", NULL, "EP"},
127}; 127};
128 128
129static int sdp4430_twl6040_init(struct snd_soc_codec *codec) 129static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)
130{ 130{
131 struct snd_soc_codec *codec = rtd->codec;
131 int ret; 132 int ret;
132 133
133 /* Add SDP4430 specific controls */ 134 /* Add SDP4430 specific controls */
@@ -164,8 +165,10 @@ static int sdp4430_twl6040_init(struct snd_soc_codec *codec)
164static struct snd_soc_dai_link sdp4430_dai = { 165static struct snd_soc_dai_link sdp4430_dai = {
165 .name = "TWL6040", 166 .name = "TWL6040",
166 .stream_name = "TWL6040", 167 .stream_name = "TWL6040",
167 .cpu_dai = &omap_mcpdm_dai, 168 .cpu_dai_name ="omap-mcpdm-dai",
168 .codec_dai = &twl6040_dai, 169 .codec_dai_name = "twl6040-hifi",
170 .platform_name = "omap-pcm-audio",
171 .codec_name = "twl6040-codec",
169 .init = sdp4430_twl6040_init, 172 .init = sdp4430_twl6040_init,
170 .ops = &sdp4430_ops, 173 .ops = &sdp4430_ops,
171}; 174};
@@ -173,27 +176,18 @@ static struct snd_soc_dai_link sdp4430_dai = {
173/* Audio machine driver */ 176/* Audio machine driver */
174static struct snd_soc_card snd_soc_sdp4430 = { 177static struct snd_soc_card snd_soc_sdp4430 = {
175 .name = "SDP4430", 178 .name = "SDP4430",
176 .platform = &omap_soc_platform,
177 .dai_link = &sdp4430_dai, 179 .dai_link = &sdp4430_dai,
178 .num_links = 1, 180 .num_links = 1,
179}; 181};
180 182
181/* Audio subsystem */
182static struct snd_soc_device sdp4430_snd_devdata = {
183 .card = &snd_soc_sdp4430,
184 .codec_dev = &soc_codec_dev_twl6040,
185};
186
187static struct platform_device *sdp4430_snd_device; 183static struct platform_device *sdp4430_snd_device;
188 184
189static int __init sdp4430_soc_init(void) 185static int __init sdp4430_soc_init(void)
190{ 186{
191 int ret; 187 int ret;
192 188
193 if (!machine_is_omap_4430sdp()) { 189 if (!machine_is_omap_4430sdp())
194 pr_debug("Not SDP4430!\n");
195 return -ENODEV; 190 return -ENODEV;
196 }
197 printk(KERN_INFO "SDP4430 SoC init\n"); 191 printk(KERN_INFO "SDP4430 SoC init\n");
198 192
199 sdp4430_snd_device = platform_device_alloc("soc-audio", -1); 193 sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
@@ -202,8 +196,7 @@ static int __init sdp4430_soc_init(void)
202 return -ENOMEM; 196 return -ENOMEM;
203 } 197 }
204 198
205 platform_set_drvdata(sdp4430_snd_device, &sdp4430_snd_devdata); 199 platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430);
206 sdp4430_snd_devdata.dev = &sdp4430_snd_device->dev;
207 200
208 ret = platform_device_add(sdp4430_snd_device); 201 ret = platform_device_add(sdp4430_snd_device);
209 if (ret) 202 if (ret)