blob: 58f1dd4760eef72a39a6b07d21d7008ff6a1b589 [file] [log] [blame]
Thomas Gleixnerb886d832019-06-01 10:08:55 +02001// SPDX-License-Identifier: GPL-2.0-only
Wan ZongShun1082e272010-05-18 13:41:46 +08002/*
3 * Copyright (c) 2010 Nuvoton technology corporation.
4 *
5 * Wan ZongShun <mcuos.com@gmail.com>
Wan ZongShun1082e272010-05-18 13:41:46 +08006 */
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>
Wan ZongShun1082e272010-05-18 13:41:46 +080017
Wan ZongShun019afb52010-06-10 10:40:40 +080018#include "nuc900-audio.h"
Wan ZongShun1082e272010-05-18 13:41:46 +080019
20static struct snd_soc_dai_link nuc900evb_ac97_dai = {
21 .name = "AC97",
22 .stream_name = "AC97 HiFi",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000023 .cpu_dai_name = "nuc900-ac97",
24 .codec_dai_name = "ac97-hifi",
25 .codec_name = "ac97-codec",
26 .platform_name = "nuc900-pcm-audio",
Wan ZongShun1082e272010-05-18 13:41:46 +080027};
28
29static struct snd_soc_card nuc900evb_audio_machine = {
30 .name = "NUC900EVB_AC97",
Axel Linb5a67042011-12-23 14:51:17 +080031 .owner = THIS_MODULE,
Wan ZongShun1082e272010-05-18 13:41:46 +080032 .dai_link = &nuc900evb_ac97_dai,
33 .num_links = 1,
Wan ZongShun1082e272010-05-18 13:41:46 +080034};
35
36static struct platform_device *nuc900evb_asoc_dev;
37
38static 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 */
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000048 platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine);
Wan ZongShun1082e272010-05-18 13:41:46 +080049
Wan ZongShun1082e272010-05-18 13:41:46 +080050 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
57out:
58 return ret;
59}
60
61static void __exit nuc900evb_audio_exit(void)
62{
63 platform_device_unregister(nuc900evb_asoc_dev);
64}
65
66module_init(nuc900evb_audio_init);
67module_exit(nuc900evb_audio_exit);
68
69MODULE_LICENSE("GPL");
70MODULE_DESCRIPTION("NUC900 Series ASoC audio support");
71MODULE_AUTHOR("Wan ZongShun");