aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2008-05-26 05:59:16 -0400
committerTakashi Iwai <tiwai@suse.de>2008-05-27 09:56:21 -0400
commit142054a389ebf7972b4eee822ad7c55ff852b649 (patch)
tree4400be813aab019f1c72dd67000b414dda5f1b3d /sound/soc/pxa
parent62cf872a8eec1f11aacbec0ac3fe3698bfa9b403 (diff)
[ALSA] Add EM-X270 ASoC driver
This patch adds ASoC support for EM-X270 machine. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/Kconfig9
-rw-r--r--sound/soc/pxa/Makefile3
-rw-r--r--sound/soc/pxa/em-x270.c102
3 files changed, 113 insertions, 1 deletions
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 18a40dc8ad9d..12f6ac99b04c 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -62,3 +62,12 @@ config SND_PXA2XX_SOC_E800
62 help 62 help
63 Say Y if you want to add support for SoC audio on the 63 Say Y if you want to add support for SoC audio on the
64 Toshiba e800 PDA 64 Toshiba e800 PDA
65
66config SND_PXA2XX_SOC_EM_X270
67 tristate "SoC Audio support for CompuLab EM-x270"
68 depends on SND_PXA2XX_SOC && MACH_EM_X270
69 select SND_PXA2XX_SOC_AC97
70 select SND_SOC_WM9712
71 help
72 Say Y if you want to add support for SoC audio on
73 CompuLab EM-x270.
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index 04e5646f75ba..5bc8edf9dca9 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -13,10 +13,11 @@ snd-soc-poodle-objs := poodle.o
13snd-soc-tosa-objs := tosa.o 13snd-soc-tosa-objs := tosa.o
14snd-soc-e800-objs := e800_wm9712.o 14snd-soc-e800-objs := e800_wm9712.o
15snd-soc-spitz-objs := spitz.o 15snd-soc-spitz-objs := spitz.o
16snd-soc-em-x270-objs := em-x270.o
16 17
17obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o 18obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
18obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o 19obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o
19obj-$(CONFIG_SND_PXA2XX_SOC_TOSA) += snd-soc-tosa.o 20obj-$(CONFIG_SND_PXA2XX_SOC_TOSA) += snd-soc-tosa.o
20obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o 21obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o
21obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o 22obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o
22 23obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o
diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c
new file mode 100644
index 000000000000..02dcac39cdf6
--- /dev/null
+++ b/sound/soc/pxa/em-x270.c
@@ -0,0 +1,102 @@
1/*
2 * em-x270.c -- SoC audio for EM-X270
3 *
4 * Copyright 2007 CompuLab, Ltd.
5 *
6 * Author: Mike Rapoport <mike@compulab.co.il>
7 *
8 * Copied from tosa.c:
9 * Copyright 2005 Wolfson Microelectronics PLC.
10 * Copyright 2005 Openedhand Ltd.
11 *
12 * Authors: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
13 * Richard Purdie <richard@openedhand.com>
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 */
21
22#include <linux/module.h>
23#include <linux/moduleparam.h>
24#include <linux/device.h>
25
26#include <sound/driver.h>
27#include <sound/core.h>
28#include <sound/pcm.h>
29#include <sound/soc.h>
30#include <sound/soc-dapm.h>
31
32#include <asm/mach-types.h>
33#include <asm/arch/pxa-regs.h>
34#include <asm/arch/hardware.h>
35#include <asm/arch/audio.h>
36
37#include "../codecs/wm9712.h"
38#include "pxa2xx-pcm.h"
39#include "pxa2xx-ac97.h"
40
41static struct snd_soc_dai_link em_x270_dai[] = {
42 {
43 .name = "AC97",
44 .stream_name = "AC97 HiFi",
45 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI],
46 .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI],
47 },
48 {
49 .name = "AC97 Aux",
50 .stream_name = "AC97 Aux",
51 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX],
52 .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX],
53 },
54};
55
56static struct snd_soc_machine em_x270 = {
57 .name = "EM-X270",
58 .dai_link = em_x270_dai,
59 .num_links = ARRAY_SIZE(em_x270_dai),
60};
61
62static struct snd_soc_device em_x270_snd_devdata = {
63 .machine = &em_x270,
64 .platform = &pxa2xx_soc_platform,
65 .codec_dev = &soc_codec_dev_wm9712,
66};
67
68static struct platform_device *em_x270_snd_device;
69
70static int __init em_x270_init(void)
71{
72 int ret;
73
74 if (!machine_is_em_x270())
75 return -ENODEV;
76
77 em_x270_snd_device = platform_device_alloc("soc-audio", -1);
78 if (!em_x270_snd_device)
79 return -ENOMEM;
80
81 platform_set_drvdata(em_x270_snd_device, &em_x270_snd_devdata);
82 em_x270_snd_devdata.dev = &em_x270_snd_device->dev;
83 ret = platform_device_add(em_x270_snd_device);
84
85 if (ret)
86 platform_device_put(em_x270_snd_device);
87
88 return ret;
89}
90
91static void __exit em_x270_exit(void)
92{
93 platform_device_unregister(em_x270_snd_device);
94}
95
96module_init(em_x270_init);
97module_exit(em_x270_exit);
98
99/* Module information */
100MODULE_AUTHOR("Mike Rapoport");
101MODULE_DESCRIPTION("ALSA SoC EM-X270");
102MODULE_LICENSE("GPL");