aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/tosa.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/tosa.c')
-rw-r--r--sound/soc/pxa/tosa.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index dbbd3e9d1637..a3bfb2e8b70f 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -33,7 +33,6 @@
33#include <mach/audio.h> 33#include <mach/audio.h>
34 34
35#include "../codecs/wm9712.h" 35#include "../codecs/wm9712.h"
36#include "pxa2xx-pcm.h"
37#include "pxa2xx-ac97.h" 36#include "pxa2xx-ac97.h"
38 37
39static struct snd_soc_card tosa; 38static struct snd_soc_card tosa;
@@ -80,7 +79,7 @@ static void tosa_ext_control(struct snd_soc_codec *codec)
80static int tosa_startup(struct snd_pcm_substream *substream) 79static int tosa_startup(struct snd_pcm_substream *substream)
81{ 80{
82 struct snd_soc_pcm_runtime *rtd = substream->private_data; 81 struct snd_soc_pcm_runtime *rtd = substream->private_data;
83 struct snd_soc_codec *codec = rtd->socdev->card->codec; 82 struct snd_soc_codec *codec = rtd->card->codec;
84 83
85 /* check the jack status at stream startup */ 84 /* check the jack status at stream startup */
86 tosa_ext_control(codec); 85 tosa_ext_control(codec);
@@ -184,8 +183,9 @@ static const struct snd_kcontrol_new tosa_controls[] = {
184 tosa_set_spk), 183 tosa_set_spk),
185}; 184};
186 185
187static int tosa_ac97_init(struct snd_soc_codec *codec) 186static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd)
188{ 187{
188 struct snd_soc_codec *codec = rtd->codec;
189 int err; 189 int err;
190 190
191 snd_soc_dapm_nc_pin(codec, "OUT3"); 191 snd_soc_dapm_nc_pin(codec, "OUT3");
@@ -212,16 +212,20 @@ static struct snd_soc_dai_link tosa_dai[] = {
212{ 212{
213 .name = "AC97", 213 .name = "AC97",
214 .stream_name = "AC97 HiFi", 214 .stream_name = "AC97 HiFi",
215 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI], 215 .cpu_dai_name = "pxa-ac97.0",
216 .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI], 216 .codec_dai_name = "wm9712-hifi",
217 .platform_name = "pxa-pcm-audio",
218 .codec_name = "wm9712-codec",
217 .init = tosa_ac97_init, 219 .init = tosa_ac97_init,
218 .ops = &tosa_ops, 220 .ops = &tosa_ops,
219}, 221},
220{ 222{
221 .name = "AC97 Aux", 223 .name = "AC97 Aux",
222 .stream_name = "AC97 Aux", 224 .stream_name = "AC97 Aux",
223 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX], 225 .cpu_dai_name = "pxa-ac97.1",
224 .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX], 226 .codec_dai_name = "wm9712-aux",
227 .platform_name = "pxa-pcm-audio",
228 .codec_name = "wm9712-codec",
225 .ops = &tosa_ops, 229 .ops = &tosa_ops,
226}, 230},
227}; 231};
@@ -248,18 +252,12 @@ static int tosa_remove(struct platform_device *dev)
248 252
249static struct snd_soc_card tosa = { 253static struct snd_soc_card tosa = {
250 .name = "Tosa", 254 .name = "Tosa",
251 .platform = &pxa2xx_soc_platform,
252 .dai_link = tosa_dai, 255 .dai_link = tosa_dai,
253 .num_links = ARRAY_SIZE(tosa_dai), 256 .num_links = ARRAY_SIZE(tosa_dai),
254 .probe = tosa_probe, 257 .probe = tosa_probe,
255 .remove = tosa_remove, 258 .remove = tosa_remove,
256}; 259};
257 260
258static struct snd_soc_device tosa_snd_devdata = {
259 .card = &tosa,
260 .codec_dev = &soc_codec_dev_wm9712,
261};
262
263static struct platform_device *tosa_snd_device; 261static struct platform_device *tosa_snd_device;
264 262
265static int __init tosa_init(void) 263static int __init tosa_init(void)
@@ -275,8 +273,7 @@ static int __init tosa_init(void)
275 goto err_alloc; 273 goto err_alloc;
276 } 274 }
277 275
278 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata); 276 platform_set_drvdata(tosa_snd_device, &tosa);
279 tosa_snd_devdata.dev = &tosa_snd_device->dev;
280 ret = platform_device_add(tosa_snd_device); 277 ret = platform_device_add(tosa_snd_device);
281 278
282 if (!ret) 279 if (!ret)