diff options
Diffstat (limited to 'sound/soc/nuc900')
-rw-r--r-- | sound/soc/nuc900/nuc900-ac97.c | 13 | ||||
-rw-r--r-- | sound/soc/nuc900/nuc900-audio.c | 16 | ||||
-rw-r--r-- | sound/soc/nuc900/nuc900-audio.h | 4 | ||||
-rw-r--r-- | sound/soc/nuc900/nuc900-pcm.c | 38 |
4 files changed, 37 insertions, 34 deletions
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index caa7c901bc2e..293dc748797c 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <sound/pcm.h> | 20 | #include <sound/pcm.h> |
21 | #include <sound/initval.h> | 21 | #include <sound/initval.h> |
22 | #include <sound/soc.h> | 22 | #include <sound/soc.h> |
23 | #include <linux/device.h> | ||
24 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
25 | 24 | ||
26 | #include <mach/mfp.h> | 25 | #include <mach/mfp.h> |
@@ -297,8 +296,7 @@ static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { | |||
297 | .trigger = nuc900_ac97_trigger, | 296 | .trigger = nuc900_ac97_trigger, |
298 | }; | 297 | }; |
299 | 298 | ||
300 | struct snd_soc_dai nuc900_ac97_dai = { | 299 | static struct snd_soc_dai_driver nuc900_ac97_dai = { |
301 | .name = "nuc900-ac97", | ||
302 | .probe = nuc900_ac97_probe, | 300 | .probe = nuc900_ac97_probe, |
303 | .remove = nuc900_ac97_remove, | 301 | .remove = nuc900_ac97_remove, |
304 | .ac97_control = 1, | 302 | .ac97_control = 1, |
@@ -316,7 +314,6 @@ struct snd_soc_dai nuc900_ac97_dai = { | |||
316 | }, | 314 | }, |
317 | .ops = &nuc900_ac97_dai_ops, | 315 | .ops = &nuc900_ac97_dai_ops, |
318 | } | 316 | } |
319 | EXPORT_SYMBOL_GPL(nuc900_ac97_dai); | ||
320 | 317 | ||
321 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) | 318 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) |
322 | { | 319 | { |
@@ -365,9 +362,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) | |||
365 | 362 | ||
366 | nuc900_ac97_data = nuc900_audio; | 363 | nuc900_ac97_data = nuc900_audio; |
367 | 364 | ||
368 | nuc900_audio->dev = nuc900_ac97_dai.dev = &pdev->dev; | 365 | ret = snd_soc_register_dai(&pdev->dev, &nuc900_ac97_dai); |
369 | |||
370 | ret = snd_soc_register_dai(&nuc900_ac97_dai); | ||
371 | if (ret) | 366 | if (ret) |
372 | goto out3; | 367 | goto out3; |
373 | 368 | ||
@@ -390,7 +385,7 @@ out0: | |||
390 | static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) | 385 | static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) |
391 | { | 386 | { |
392 | 387 | ||
393 | snd_soc_unregister_dai(&nuc900_ac97_dai); | 388 | snd_soc_unregister_dai(&pdev->dev); |
394 | 389 | ||
395 | clk_put(nuc900_ac97_data->clk); | 390 | clk_put(nuc900_ac97_data->clk); |
396 | iounmap(nuc900_ac97_data->mmio); | 391 | iounmap(nuc900_ac97_data->mmio); |
@@ -404,7 +399,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) | |||
404 | 399 | ||
405 | static struct platform_driver nuc900_ac97_driver = { | 400 | static struct platform_driver nuc900_ac97_driver = { |
406 | .driver = { | 401 | .driver = { |
407 | .name = "nuc900-audio", | 402 | .name = "nuc900-ac97", |
408 | .owner = THIS_MODULE, | 403 | .owner = THIS_MODULE, |
409 | }, | 404 | }, |
410 | .probe = nuc900_ac97_drvprobe, | 405 | .probe = nuc900_ac97_drvprobe, |
diff --git a/sound/soc/nuc900/nuc900-audio.c b/sound/soc/nuc900/nuc900-audio.c index 72e6f518f7b2..161f5b667d7b 100644 --- a/sound/soc/nuc900/nuc900-audio.c +++ b/sound/soc/nuc900/nuc900-audio.c | |||
@@ -20,26 +20,21 @@ | |||
20 | #include <sound/soc.h> | 20 | #include <sound/soc.h> |
21 | #include <sound/soc-dapm.h> | 21 | #include <sound/soc-dapm.h> |
22 | 22 | ||
23 | #include "../codecs/ac97.h" | ||
24 | #include "nuc900-audio.h" | 23 | #include "nuc900-audio.h" |
25 | 24 | ||
26 | static struct snd_soc_dai_link nuc900evb_ac97_dai = { | 25 | static struct snd_soc_dai_link nuc900evb_ac97_dai = { |
27 | .name = "AC97", | 26 | .name = "AC97", |
28 | .stream_name = "AC97 HiFi", | 27 | .stream_name = "AC97 HiFi", |
29 | .cpu_dai = &nuc900_ac97_dai, | 28 | .cpu_dai_name = "nuc900-ac97", |
30 | .codec_dai = &ac97_dai, | 29 | .codec_dai_name = "ac97-hifi", |
30 | .codec_name = "ac97-codec", | ||
31 | .platform_name = "nuc900-pcm-audio", | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | static struct snd_soc_card nuc900evb_audio_machine = { | 34 | static struct snd_soc_card nuc900evb_audio_machine = { |
34 | .name = "NUC900EVB_AC97", | 35 | .name = "NUC900EVB_AC97", |
35 | .dai_link = &nuc900evb_ac97_dai, | 36 | .dai_link = &nuc900evb_ac97_dai, |
36 | .num_links = 1, | 37 | .num_links = 1, |
37 | .platform = &nuc900_soc_platform, | ||
38 | }; | ||
39 | |||
40 | static struct snd_soc_device nuc900evb_ac97_devdata = { | ||
41 | .card = &nuc900evb_audio_machine, | ||
42 | .codec_dev = &soc_codec_dev_ac97, | ||
43 | }; | 38 | }; |
44 | 39 | ||
45 | static struct platform_device *nuc900evb_asoc_dev; | 40 | static struct platform_device *nuc900evb_asoc_dev; |
@@ -54,9 +49,8 @@ static int __init nuc900evb_audio_init(void) | |||
54 | goto out; | 49 | goto out; |
55 | 50 | ||
56 | /* nuc900 board audio device */ | 51 | /* nuc900 board audio device */ |
57 | platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_ac97_devdata); | 52 | platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine); |
58 | 53 | ||
59 | nuc900evb_ac97_devdata.dev = &nuc900evb_asoc_dev->dev; | ||
60 | ret = platform_device_add(nuc900evb_asoc_dev); | 54 | ret = platform_device_add(nuc900evb_asoc_dev); |
61 | 55 | ||
62 | if (ret) { | 56 | if (ret) { |
diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h index 3038f519729f..aeed8ead2b2b 100644 --- a/sound/soc/nuc900/nuc900-audio.h +++ b/sound/soc/nuc900/nuc900-audio.h | |||
@@ -110,8 +110,4 @@ struct nuc900_audio { | |||
110 | 110 | ||
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern struct nuc900_audio *nuc900_ac97_data; | ||
114 | extern struct snd_soc_dai nuc900_ac97_dai; | ||
115 | extern struct snd_soc_platform nuc900_soc_platform; | ||
116 | |||
117 | #endif /*end _NUC900_AUDIO_H */ | 113 | #endif /*end _NUC900_AUDIO_H */ |
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index e81e803b3a63..195d1ac94771 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c | |||
@@ -328,26 +328,44 @@ static int nuc900_dma_new(struct snd_card *card, | |||
328 | return 0; | 328 | return 0; |
329 | } | 329 | } |
330 | 330 | ||
331 | struct snd_soc_platform nuc900_soc_platform = { | 331 | static struct snd_soc_platform_driver nuc900_soc_platform = { |
332 | .name = "nuc900-dma", | 332 | .ops = &nuc900_dma_ops, |
333 | .pcm_ops = &nuc900_dma_ops, | ||
334 | .pcm_new = nuc900_dma_new, | 333 | .pcm_new = nuc900_dma_new, |
335 | .pcm_free = nuc900_dma_free_dma_buffers, | 334 | .pcm_free = nuc900_dma_free_dma_buffers, |
336 | } | 335 | } |
337 | EXPORT_SYMBOL_GPL(nuc900_soc_platform); | ||
338 | 336 | ||
339 | static int __init nuc900_soc_platform_init(void) | 337 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) |
340 | { | 338 | { |
341 | return snd_soc_register_platform(&nuc900_soc_platform); | 339 | return snd_soc_register_platform(&pdev->dev, &nuc900_soc_platform); |
342 | } | 340 | } |
343 | 341 | ||
344 | static void __exit nuc900_soc_platform_exit(void) | 342 | static int __devexit nuc900_soc_platform_remove(struct platform_device *pdev) |
345 | { | 343 | { |
346 | snd_soc_unregister_platform(&nuc900_soc_platform); | 344 | snd_soc_unregister_platform(&pdev->dev); |
345 | return 0; | ||
347 | } | 346 | } |
348 | 347 | ||
349 | module_init(nuc900_soc_platform_init); | 348 | static struct platform_driver nuc900_pcm_driver = { |
350 | module_exit(nuc900_soc_platform_exit); | 349 | .driver = { |
350 | .name = "nuc900-pcm-audio", | ||
351 | .owner = THIS_MODULE, | ||
352 | }, | ||
353 | |||
354 | .probe = nuc900_soc_platform_probe, | ||
355 | .remove = __devexit_p(nuc900_soc_platform_remove), | ||
356 | }; | ||
357 | |||
358 | static int __init nuc900_pcm_init(void) | ||
359 | { | ||
360 | return platform_driver_register(&nuc900_pcm_driver); | ||
361 | } | ||
362 | module_init(nuc900_pcm_init); | ||
363 | |||
364 | static void __exit nuc900_pcm_exit(void) | ||
365 | { | ||
366 | platform_driver_unregister(&nuc900_pcm_driver); | ||
367 | } | ||
368 | module_exit(nuc900_pcm_exit); | ||
351 | 369 | ||
352 | MODULE_AUTHOR("Wan ZongShun, <mcuos.com@gmail.com>"); | 370 | MODULE_AUTHOR("Wan ZongShun, <mcuos.com@gmail.com>"); |
353 | MODULE_DESCRIPTION("nuc900 Audio DMA module"); | 371 | MODULE_DESCRIPTION("nuc900 Audio DMA module"); |