]>
Commit | Line | Data |
---|---|---|
b886d83c | 1 | // SPDX-License-Identifier: GPL-2.0-only |
1082e270 WZ |
2 | /* |
3 | * Copyright (c) 2010 Nuvoton technology corporation. | |
4 | * | |
5 | * Wan ZongShun <mcuos.com@gmail.com> | |
1082e270 WZ |
6 | */ |
7 | ||
8 | #include <linux/module.h> | |
9 | #include <linux/moduleparam.h> | |
10 | #include <linux/timer.h> | |
11 | #include <linux/interrupt.h> | |
12 | #include <linux/platform_device.h> | |
13 | ||
14 | #include <sound/core.h> | |
15 | #include <sound/pcm.h> | |
16 | #include <sound/soc.h> | |
1082e270 | 17 | |
019afb58 | 18 | #include "nuc900-audio.h" |
1082e270 WZ |
19 | |
20 | static struct snd_soc_dai_link nuc900evb_ac97_dai = { | |
21 | .name = "AC97", | |
22 | .stream_name = "AC97 HiFi", | |
f0fba2ad LG |
23 | .cpu_dai_name = "nuc900-ac97", |
24 | .codec_dai_name = "ac97-hifi", | |
25 | .codec_name = "ac97-codec", | |
26 | .platform_name = "nuc900-pcm-audio", | |
1082e270 WZ |
27 | }; |
28 | ||
29 | static struct snd_soc_card nuc900evb_audio_machine = { | |
30 | .name = "NUC900EVB_AC97", | |
b5a67048 | 31 | .owner = THIS_MODULE, |
1082e270 WZ |
32 | .dai_link = &nuc900evb_ac97_dai, |
33 | .num_links = 1, | |
1082e270 WZ |
34 | }; |
35 | ||
36 | static struct platform_device *nuc900evb_asoc_dev; | |
37 | ||
38 | static int __init nuc900evb_audio_init(void) | |
39 | { | |
40 | int ret; | |
41 | ||
42 | ret = -ENOMEM; | |
43 | nuc900evb_asoc_dev = platform_device_alloc("soc-audio", -1); | |
44 | if (!nuc900evb_asoc_dev) | |
45 | goto out; | |
46 | ||
47 | /* nuc900 board audio device */ | |
f0fba2ad | 48 | platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine); |
1082e270 | 49 | |
1082e270 WZ |
50 | ret = platform_device_add(nuc900evb_asoc_dev); |
51 | ||
52 | if (ret) { | |
53 | platform_device_put(nuc900evb_asoc_dev); | |
54 | nuc900evb_asoc_dev = NULL; | |
55 | } | |
56 | ||
57 | out: | |
58 | return ret; | |
59 | } | |
60 | ||
61 | static void __exit nuc900evb_audio_exit(void) | |
62 | { | |
63 | platform_device_unregister(nuc900evb_asoc_dev); | |
64 | } | |
65 | ||
66 | module_init(nuc900evb_audio_init); | |
67 | module_exit(nuc900evb_audio_exit); | |
68 | ||
69 | MODULE_LICENSE("GPL"); | |
70 | MODULE_DESCRIPTION("NUC900 Series ASoC audio support"); | |
71 | MODULE_AUTHOR("Wan ZongShun"); |