1 // SPDX-License-Identifier: GPL-2.0-or-later
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>
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
[] = {
41 .stream_name
= "AC97 HiFi",
42 SND_SOC_DAILINK_REG(ac97
),
46 .stream_name
= "AC97 Aux",
47 SND_SOC_DAILINK_REG(ac97_aux
),
51 static struct snd_soc_card em_x270
= {
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)
64 if (!(machine_is_em_x270() || machine_is_exeda()
65 || machine_is_cm_x300()))
68 em_x270_snd_device
= platform_device_alloc("soc-audio", -1);
69 if (!em_x270_snd_device
)
72 platform_set_drvdata(em_x270_snd_device
, &em_x270
);
73 ret
= platform_device_add(em_x270_snd_device
);
76 platform_device_put(em_x270_snd_device
);
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");