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 static struct snd_soc_dai_link em_x270_dai[] = {
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",
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",
47 static struct snd_soc_card em_x270 = {
50 .dai_link = em_x270_dai,
51 .num_links = ARRAY_SIZE(em_x270_dai),
54 static struct platform_device *em_x270_snd_device;
56 static int __init em_x270_init(void)
60 if (!(machine_is_em_x270() || machine_is_exeda()
61 || machine_is_cm_x300()))
64 em_x270_snd_device = platform_device_alloc("soc-audio", -1);
65 if (!em_x270_snd_device)
68 platform_set_drvdata(em_x270_snd_device, &em_x270);
69 ret = platform_device_add(em_x270_snd_device);
72 platform_device_put(em_x270_snd_device);
77 static void __exit em_x270_exit(void)
79 platform_device_unregister(em_x270_snd_device);
82 module_init(em_x270_init);
83 module_exit(em_x270_exit);
85 /* Module information */
86 MODULE_AUTHOR("Mike Rapoport");
87 MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300");
88 MODULE_LICENSE("GPL");