Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / sound / soc / pxa / em-x270.c
blob9076ea7e93396022d9393ab893d22296772cf342
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * SoC audio driver for EM-X270, eXeda and CM-X300
5 * Copyright 2007, 2009 CompuLab, Ltd.
7 * Author: Mike Rapoport <mike@compulab.co.il>
9 * Copied from tosa.c:
10 * Copyright 2005 Wolfson Microelectronics PLC.
11 * Copyright 2005 Openedhand Ltd.
13 * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
14 * Richard Purdie <richard@openedhand.com>
17 #include <linux/module.h>
18 #include <linux/moduleparam.h>
19 #include <linux/device.h>
21 #include <sound/core.h>
22 #include <sound/pcm.h>
23 #include <sound/soc.h>
25 #include <asm/mach-types.h>
26 #include <mach/audio.h>
28 SND_SOC_DAILINK_DEFS(ac97,
29 DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
30 DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
31 DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
33 SND_SOC_DAILINK_DEFS(ac97_aux,
34 DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
35 DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
36 DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
38 static struct snd_soc_dai_link em_x270_dai[] = {
40 .name = "AC97",
41 .stream_name = "AC97 HiFi",
42 SND_SOC_DAILINK_REG(ac97),
45 .name = "AC97 Aux",
46 .stream_name = "AC97 Aux",
47 SND_SOC_DAILINK_REG(ac97_aux),
51 static struct snd_soc_card em_x270 = {
52 .name = "EM-X270",
53 .owner = THIS_MODULE,
54 .dai_link = em_x270_dai,
55 .num_links = ARRAY_SIZE(em_x270_dai),
58 static struct platform_device *em_x270_snd_device;
60 static int __init em_x270_init(void)
62 int ret;
64 if (!(machine_is_em_x270() || machine_is_exeda()
65 || machine_is_cm_x300()))
66 return -ENODEV;
68 em_x270_snd_device = platform_device_alloc("soc-audio", -1);
69 if (!em_x270_snd_device)
70 return -ENOMEM;
72 platform_set_drvdata(em_x270_snd_device, &em_x270);
73 ret = platform_device_add(em_x270_snd_device);
75 if (ret)
76 platform_device_put(em_x270_snd_device);
78 return ret;
81 static void __exit em_x270_exit(void)
83 platform_device_unregister(em_x270_snd_device);
86 module_init(em_x270_init);
87 module_exit(em_x270_exit);
89 /* Module information */
90 MODULE_AUTHOR("Mike Rapoport");
91 MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300");
92 MODULE_LICENSE("GPL");