blob: 38a2d0d883b53f592e5512546c9245ca57399209 [file] [log] [blame]
Wan ZongShun1082e272010-05-18 13:41:46 +08001/*
2 * Copyright (c) 2010 Nuvoton technology corporation.
3 *
4 * Wan ZongShun <mcuos.com@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation;version 2 of the License.
9 *
10 */
11
12#include <linux/module.h>
13#include <linux/moduleparam.h>
14#include <linux/timer.h>
15#include <linux/interrupt.h>
16#include <linux/platform_device.h>
17
18#include <sound/core.h>
19#include <sound/pcm.h>
20#include <sound/soc.h>
Wan ZongShun1082e272010-05-18 13:41:46 +080021
Wan ZongShun019afb52010-06-10 10:40:40 +080022#include "nuc900-audio.h"
Wan ZongShun1082e272010-05-18 13:41:46 +080023
24static struct snd_soc_dai_link nuc900evb_ac97_dai = {
25 .name = "AC97",
26 .stream_name = "AC97 HiFi",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000027 .cpu_dai_name = "nuc900-ac97",
28 .codec_dai_name = "ac97-hifi",
29 .codec_name = "ac97-codec",
30 .platform_name = "nuc900-pcm-audio",
Wan ZongShun1082e272010-05-18 13:41:46 +080031};
32
33static struct snd_soc_card nuc900evb_audio_machine = {
34 .name = "NUC900EVB_AC97",
35 .dai_link = &nuc900evb_ac97_dai,
36 .num_links = 1,
Wan ZongShun1082e272010-05-18 13:41:46 +080037};
38
39static struct platform_device *nuc900evb_asoc_dev;
40
41static int __init nuc900evb_audio_init(void)
42{
43 int ret;
44
45 ret = -ENOMEM;
46 nuc900evb_asoc_dev = platform_device_alloc("soc-audio", -1);
47 if (!nuc900evb_asoc_dev)
48 goto out;
49
50 /* nuc900 board audio device */
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000051 platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine);
Wan ZongShun1082e272010-05-18 13:41:46 +080052
Wan ZongShun1082e272010-05-18 13:41:46 +080053 ret = platform_device_add(nuc900evb_asoc_dev);
54
55 if (ret) {
56 platform_device_put(nuc900evb_asoc_dev);
57 nuc900evb_asoc_dev = NULL;
58 }
59
60out:
61 return ret;
62}
63
64static void __exit nuc900evb_audio_exit(void)
65{
66 platform_device_unregister(nuc900evb_asoc_dev);
67}
68
69module_init(nuc900evb_audio_init);
70module_exit(nuc900evb_audio_exit);
71
72MODULE_LICENSE("GPL");
73MODULE_DESCRIPTION("NUC900 Series ASoC audio support");
74MODULE_AUTHOR("Wan ZongShun");