]> asedeno.scripts.mit.edu Git - linux.git/blob - sound/soc/pxa/em-x270.c
Merge branch 'next' into for-linus
[linux.git] / sound / soc / pxa / em-x270.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * SoC audio driver for EM-X270, eXeda and CM-X300
4  *
5  * Copyright 2007, 2009 CompuLab, Ltd.
6  *
7  * Author: Mike Rapoport <mike@compulab.co.il>
8  *
9  * Copied from tosa.c:
10  * Copyright 2005 Wolfson Microelectronics PLC.
11  * Copyright 2005 Openedhand Ltd.
12  *
13  * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
14  *          Richard Purdie <richard@openedhand.com>
15  */
16
17 #include <linux/module.h>
18 #include <linux/moduleparam.h>
19 #include <linux/device.h>
20
21 #include <sound/core.h>
22 #include <sound/pcm.h>
23 #include <sound/soc.h>
24
25 #include <asm/mach-types.h>
26 #include <mach/audio.h>
27
28 static struct snd_soc_dai_link em_x270_dai[] = {
29         {
30                 .name = "AC97",
31                 .stream_name = "AC97 HiFi",
32                 .cpu_dai_name = "pxa2xx-ac97",
33                 .codec_dai_name = "wm9712-hifi",
34                 .platform_name = "pxa-pcm-audio",
35                 .codec_name = "wm9712-codec",
36         },
37         {
38                 .name = "AC97 Aux",
39                 .stream_name = "AC97 Aux",
40                 .cpu_dai_name = "pxa2xx-ac97-aux",
41                 .codec_dai_name = "wm9712-aux",
42                 .platform_name = "pxa-pcm-audio",
43                 .codec_name = "wm9712-codec",
44         },
45 };
46
47 static struct snd_soc_card em_x270 = {
48         .name = "EM-X270",
49         .owner = THIS_MODULE,
50         .dai_link = em_x270_dai,
51         .num_links = ARRAY_SIZE(em_x270_dai),
52 };
53
54 static struct platform_device *em_x270_snd_device;
55
56 static int __init em_x270_init(void)
57 {
58         int ret;
59
60         if (!(machine_is_em_x270() || machine_is_exeda()
61               || machine_is_cm_x300()))
62                 return -ENODEV;
63
64         em_x270_snd_device = platform_device_alloc("soc-audio", -1);
65         if (!em_x270_snd_device)
66                 return -ENOMEM;
67
68         platform_set_drvdata(em_x270_snd_device, &em_x270);
69         ret = platform_device_add(em_x270_snd_device);
70
71         if (ret)
72                 platform_device_put(em_x270_snd_device);
73
74         return ret;
75 }
76
77 static void __exit em_x270_exit(void)
78 {
79         platform_device_unregister(em_x270_snd_device);
80 }
81
82 module_init(em_x270_init);
83 module_exit(em_x270_exit);
84
85 /* Module information */
86 MODULE_AUTHOR("Mike Rapoport");
87 MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300");
88 MODULE_LICENSE("GPL");