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 caa7c901bc2..293dc748797 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -20,7 +20,6 @@ #include <sound/pcm.h> #include <sound/initval.h> #include <sound/soc.h> -#include <linux/device.h> #include <linux/clk.h> #include <mach/mfp.h> @@ -297,8 +296,7 @@ static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { .trigger = nuc900_ac97_trigger, }; -struct snd_soc_dai nuc900_ac97_dai = { - .name = "nuc900-ac97", +static struct snd_soc_dai_driver nuc900_ac97_dai = { .probe = nuc900_ac97_probe, .remove = nuc900_ac97_remove, .ac97_control = 1, @@ -316,7 +314,6 @@ struct snd_soc_dai nuc900_ac97_dai = { }, .ops = &nuc900_ac97_dai_ops, } -EXPORT_SYMBOL_GPL(nuc900_ac97_dai); static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) { @@ -365,9 +362,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) nuc900_ac97_data = nuc900_audio; - nuc900_audio->dev = nuc900_ac97_dai.dev = &pdev->dev; - - ret = snd_soc_register_dai(&nuc900_ac97_dai); + ret = snd_soc_register_dai(&pdev->dev, &nuc900_ac97_dai); if (ret) goto out3; @@ -390,7 +385,7 @@ out0: static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) { - snd_soc_unregister_dai(&nuc900_ac97_dai); + snd_soc_unregister_dai(&pdev->dev); clk_put(nuc900_ac97_data->clk); iounmap(nuc900_ac97_data->mmio); @@ -404,7 +399,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) static struct platform_driver nuc900_ac97_driver = { .driver = { - .name = "nuc900-audio", + .name = "nuc900-ac97", .owner = THIS_MODULE, }, .probe = nuc900_ac97_drvprobe, diff --git a/sound/soc/nuc900/nuc900-audio.c b/sound/soc/nuc900/nuc900-audio.c index 72e6f518f7b..161f5b667d7 100644 --- a/sound/soc/nuc900/nuc900-audio.c +++ b/sound/soc/nuc900/nuc900-audio.c @@ -20,26 +20,21 @@ #include <sound/soc.h> #include <sound/soc-dapm.h> -#include "../codecs/ac97.h" #include "nuc900-audio.h" static struct snd_soc_dai_link nuc900evb_ac97_dai = { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai = &nuc900_ac97_dai, - .codec_dai = &ac97_dai, + .cpu_dai_name = "nuc900-ac97", + .codec_dai_name = "ac97-hifi", + .codec_name = "ac97-codec", + .platform_name = "nuc900-pcm-audio", }; static struct snd_soc_card nuc900evb_audio_machine = { .name = "NUC900EVB_AC97", .dai_link = &nuc900evb_ac97_dai, .num_links = 1, - .platform = &nuc900_soc_platform, -}; - -static struct snd_soc_device nuc900evb_ac97_devdata = { - .card = &nuc900evb_audio_machine, - .codec_dev = &soc_codec_dev_ac97, }; static struct platform_device *nuc900evb_asoc_dev; @@ -54,9 +49,8 @@ static int __init nuc900evb_audio_init(void) goto out; /* nuc900 board audio device */ - platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_ac97_devdata); + platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine); - nuc900evb_ac97_devdata.dev = &nuc900evb_asoc_dev->dev; ret = platform_device_add(nuc900evb_asoc_dev); if (ret) { diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h index 3038f519729..aeed8ead2b2 100644 --- a/sound/soc/nuc900/nuc900-audio.h +++ b/sound/soc/nuc900/nuc900-audio.h @@ -110,8 +110,4 @@ struct nuc900_audio { }; -extern struct nuc900_audio *nuc900_ac97_data; -extern struct snd_soc_dai nuc900_ac97_dai; -extern struct snd_soc_platform nuc900_soc_platform; - #endif /*end _NUC900_AUDIO_H */ diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index e81e803b3a6..195d1ac9477 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, return 0; } -struct snd_soc_platform nuc900_soc_platform = { - .name = "nuc900-dma", - .pcm_ops = &nuc900_dma_ops, +static struct snd_soc_platform_driver nuc900_soc_platform = { + .ops = &nuc900_dma_ops, .pcm_new = nuc900_dma_new, .pcm_free = nuc900_dma_free_dma_buffers, } -EXPORT_SYMBOL_GPL(nuc900_soc_platform); -static int __init nuc900_soc_platform_init(void) +static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) { - return snd_soc_register_platform(&nuc900_soc_platform); + return snd_soc_register_platform(&pdev->dev, &nuc900_soc_platform); } -static void __exit nuc900_soc_platform_exit(void) +static int __devexit nuc900_soc_platform_remove(struct platform_device *pdev) { - snd_soc_unregister_platform(&nuc900_soc_platform); + snd_soc_unregister_platform(&pdev->dev); + return 0; } -module_init(nuc900_soc_platform_init); -module_exit(nuc900_soc_platform_exit); +static struct platform_driver nuc900_pcm_driver = { + .driver = { + .name = "nuc900-pcm-audio", + .owner = THIS_MODULE, + }, + + .probe = nuc900_soc_platform_probe, + .remove = __devexit_p(nuc900_soc_platform_remove), +}; + +static int __init nuc900_pcm_init(void) +{ + return platform_driver_register(&nuc900_pcm_driver); +} +module_init(nuc900_pcm_init); + +static void __exit nuc900_pcm_exit(void) +{ + platform_driver_unregister(&nuc900_pcm_driver); +} +module_exit(nuc900_pcm_exit); MODULE_AUTHOR("Wan ZongShun, <mcuos.com@gmail.com>"); MODULE_DESCRIPTION("nuc900 Audio DMA module"); |