aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kuten <ivan.kuten@promwad.com>2007-10-26 08:53:47 -0400
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:10 -0500
commit040956fabbc16b9ce746a03d2b589052e1771138 (patch)
treea9f22ff5a1d12c7f59aee647e55ffea72e30d435
parentf651b50b9d1ab44f7b09d1ef28ba702903732fd3 (diff)
[ALSA] soc - ln2440sbc ac97 support
This patch adds ac97 support for ln2440sbc board from LittleChips. This board is based on s3c2440 SoC + AC97 Realtek ALC650 codec. Existing s3c2443 implementation is slightly modified because s3c2440 and s3c2443 have different AC97 interrupts. Signed-off-by: Ivan Kuten <ivan.kuten@promwad.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--sound/soc/s3c24xx/Kconfig8
-rw-r--r--sound/soc/s3c24xx/Makefile2
-rw-r--r--sound/soc/s3c24xx/ln2440sbc_alc650.c86
-rw-r--r--sound/soc/s3c24xx/s3c2443-ac97.c4
-rw-r--r--sound/soc/s3c24xx/s3c24xx-ac97.h6
5 files changed, 104 insertions, 2 deletions
diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
index 5632a2e1518d..14def2e5ada5 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -34,4 +34,12 @@ config SND_S3C24XX_SOC_SMDK2443_WM9710
34 Say Y if you want to add support for SoC audio on smdk2443 34 Say Y if you want to add support for SoC audio on smdk2443
35 with the WM9710. 35 with the WM9710.
36 36
37config SND_S3C24XX_SOC_LN2440SBC_ALC650
38 tristate "SoC AC97 Audio support for LN2440SBC - ALC650"
39 depends on SND_S3C24XX_SOC
40 select SND_S3C2443_SOC_AC97
41 select SND_SOC_AC97_CODEC
42 help
43 Say Y if you want to add support for SoC audio on ln2440sbc
44 with the ALC650.
37 45
diff --git a/sound/soc/s3c24xx/Makefile b/sound/soc/s3c24xx/Makefile
index 13c92f0fa1e4..947191961673 100644
--- a/sound/soc/s3c24xx/Makefile
+++ b/sound/soc/s3c24xx/Makefile
@@ -10,6 +10,8 @@ obj-$(CONFIG_SND_S3C2443_SOC_AC97) += snd-soc-s3c2443-ac97.o
10# S3C24XX Machine Support 10# S3C24XX Machine Support
11snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o 11snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o
12snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o 12snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o
13snd-soc-ln2440sbc-alc650-objs := ln2440sbc_alc650.o
13 14
14obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o 15obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
15obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o 16obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o
17obj-$(CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650) += snd-soc-ln2440sbc-alc650.o
diff --git a/sound/soc/s3c24xx/ln2440sbc_alc650.c b/sound/soc/s3c24xx/ln2440sbc_alc650.c
new file mode 100644
index 000000000000..ec0d1a23c18b
--- /dev/null
+++ b/sound/soc/s3c24xx/ln2440sbc_alc650.c
@@ -0,0 +1,86 @@
1/*
2 * SoC audio for ln2440sbc
3 *
4 * Copyright 2007 KonekTel, a.s.
5 * Author: Ivan Kuten
6 * ivan.kuten@promwad.com
7 *
8 * Heavily based on smdk2443_wm9710.c
9 * Copyright 2007 Wolfson Microelectronics PLC.
10 * Author: Graeme Gregory
11 * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 *
17 */
18
19#include <linux/module.h>
20#include <linux/device.h>
21#include <sound/driver.h>
22#include <sound/core.h>
23#include <sound/pcm.h>
24#include <sound/soc.h>
25#include <sound/soc-dapm.h>
26
27#include "../codecs/ac97.h"
28#include "s3c24xx-pcm.h"
29#include "s3c24xx-ac97.h"
30
31static struct snd_soc_machine ln2440sbc;
32
33static struct snd_soc_dai_link ln2440sbc_dai[] = {
34{
35 .name = "AC97",
36 .stream_name = "AC97 HiFi",
37 .cpu_dai = &s3c2443_ac97_dai[0],
38 .codec_dai = &ac97_dai,
39},
40};
41
42static struct snd_soc_machine ln2440sbc = {
43 .name = "LN2440SBC",
44 .dai_link = ln2440sbc_dai,
45 .num_links = ARRAY_SIZE(ln2440sbc_dai),
46};
47
48static struct snd_soc_device ln2440sbc_snd_ac97_devdata = {
49 .machine = &ln2440sbc,
50 .platform = &s3c24xx_soc_platform,
51 .codec_dev = &soc_codec_dev_ac97,
52};
53
54static struct platform_device *ln2440sbc_snd_ac97_device;
55
56static int __init ln2440sbc_init(void)
57{
58 int ret;
59
60 ln2440sbc_snd_ac97_device = platform_device_alloc("soc-audio", -1);
61 if (!ln2440sbc_snd_ac97_device)
62 return -ENOMEM;
63
64 platform_set_drvdata(ln2440sbc_snd_ac97_device,
65 &ln2440sbc_snd_ac97_devdata);
66 ln2440sbc_snd_ac97_devdata.dev = &ln2440sbc_snd_ac97_device->dev;
67 ret = platform_device_add(ln2440sbc_snd_ac97_device);
68
69 if (ret)
70 platform_device_put(ln2440sbc_snd_ac97_device);
71
72 return ret;
73}
74
75static void __exit ln2440sbc_exit(void)
76{
77 platform_device_unregister(ln2440sbc_snd_ac97_device);
78}
79
80module_init(ln2440sbc_init);
81module_exit(ln2440sbc_exit);
82
83/* Module information */
84MODULE_AUTHOR("Ivan Kuten");
85MODULE_DESCRIPTION("ALSA SoC ALC650 LN2440SBC");
86MODULE_LICENSE("GPL");
diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c
index 758a2637e7ac..96605b72e71c 100644
--- a/sound/soc/s3c24xx/s3c2443-ac97.c
+++ b/sound/soc/s3c24xx/s3c2443-ac97.c
@@ -253,7 +253,7 @@ static int s3c2443_ac97_probe(struct platform_device *pdev)
253 ac_glbctrl |= S3C_AC97_GLBCTRL_TRANSFERDATAENABLE; 253 ac_glbctrl |= S3C_AC97_GLBCTRL_TRANSFERDATAENABLE;
254 writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); 254 writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
255 255
256 ret = request_irq(IRQ_S3C2443_AC97, s3c2443_ac97_irq, 256 ret = request_irq(IRQ_S3C244x_AC97, s3c2443_ac97_irq,
257 IRQF_DISABLED, "AC97", NULL); 257 IRQF_DISABLED, "AC97", NULL);
258 if (ret < 0) { 258 if (ret < 0) {
259 printk(KERN_ERR "s3c24xx-ac97: interrupt request failed.\n"); 259 printk(KERN_ERR "s3c24xx-ac97: interrupt request failed.\n");
@@ -266,7 +266,7 @@ static int s3c2443_ac97_probe(struct platform_device *pdev)
266 266
267static void s3c2443_ac97_remove(struct platform_device *pdev) 267static void s3c2443_ac97_remove(struct platform_device *pdev)
268{ 268{
269 free_irq(IRQ_S3C2443_AC97, NULL); 269 free_irq(IRQ_S3C244x_AC97, NULL);
270 clk_disable(s3c24xx_ac97.ac97_clk); 270 clk_disable(s3c24xx_ac97.ac97_clk);
271 clk_put(s3c24xx_ac97.ac97_clk); 271 clk_put(s3c24xx_ac97.ac97_clk);
272 iounmap(s3c24xx_ac97.regs); 272 iounmap(s3c24xx_ac97.regs);
diff --git a/sound/soc/s3c24xx/s3c24xx-ac97.h b/sound/soc/s3c24xx/s3c24xx-ac97.h
index 2b835e8260fa..bf03e8ed16c3 100644
--- a/sound/soc/s3c24xx/s3c24xx-ac97.h
+++ b/sound/soc/s3c24xx/s3c24xx-ac97.h
@@ -20,6 +20,12 @@
20#define AC_CMD_ADDR(x) (x << 16) 20#define AC_CMD_ADDR(x) (x << 16)
21#define AC_CMD_DATA(x) (x & 0xffff) 21#define AC_CMD_DATA(x) (x & 0xffff)
22 22
23#ifdef CONFIG_CPU_S3C2440
24#define IRQ_S3C244x_AC97 IRQ_S3C2440_AC97
25#else
26#define IRQ_S3C244x_AC97 IRQ_S3C2443_AC97
27#endif
28
23extern struct snd_soc_cpu_dai s3c2443_ac97_dai[]; 29extern struct snd_soc_cpu_dai s3c2443_ac97_dai[];
24 30
25#endif /*S3C24XXAC97_H_*/ 31#endif /*S3C24XXAC97_H_*/