aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 22:52:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 22:52:22 -0400
commit1286da8bc009cb2aee7f285e94623fc974c0c983 (patch)
tree51ec0a79c3de63fa809b831ae0cbb5b85e44482f /sound/soc/davinci
parent9e220385c4eb8b7e66174a60ea0e15b6b296f228 (diff)
parent1ba65ae4bdbd43265c51ee4c30ff21a48124b6d8 (diff)
Merge tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "A relative calm release at this time with a flat diffstat. The only significant change in the ALSA core side is the support for more than 32 card instances, configurable via kconfig. Other than that, in both ASoC and other parts, mostly some improvements and fixes on the driver side. - hda: More quirks for ALC269-variants on Dell & co, VIA codec fixes - hda: Haswell HDMI audio fixes, runtime PM improvements - hda: Intel BayTrail support, ALC5505 DSP support - es1968: MediaForte M56VAP support - usb-audio: Improved support for Yamaha/Roland devices - usb-audio: M2Tech hiFace, Audio Advantage Micro II support - hdspm: wordclock fixes - ASoC: Pending fixes for WM8962 - ASoC: Cleanups and fixes for Blackfin, SGTL5000 and UX500 - ASoC: Generalisation of the Bluetooth and HDMI stub drivers - ASoC: SSM2518 and RT5640 codec drivers. - ASoC: Tegra CPUs with RT5640 machine driver - ASoC: AC'97 refactoring bug fixes - ASoC: ADAU1701 driver fixes - Clean up of *_set_drvdata() in a wide range of drivers" * tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (284 commits) ALSA: vmaster: Fix the regression of missing vmaster hook call ALSA: hda - Add Dell SSID to support Headset Mic recording ASoC: adau1701: remove control_data assignment ASoC: adau1701: more direct regmap usage ASoC: ac97: fixup multi-platform AC'97 module build failure ASoC: pxa2xx: fixup multi-platform AC'97 build failures ASoC: tegra20-ac97: Remove unused variable ASoC: tegra20-ac97: Remove duplicate error message ALSA: usb-audio: Add Audio Advantage Micro II ASoC: tas5086: fix Mid-Z implementation ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size ALSA: Replace the magic number 44 with const ALSA: hda - Fix the max length of control name in generic parser ALSA: hda - Guess what, it's two more Dell headset mic quirks ALSA: hda - Yet another Dell headset mic quirk ALSA: hda - Add support for ALC5505 DSP power-save mode ASoC: mfld: Remove unused variable ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE ALSA: usb-audio: claim autodetected PCM interfaces all at once ALSA: usb-audio: remove superfluous Roland quirks ...
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/Kconfig10
-rw-r--r--sound/soc/davinci/Makefile2
-rw-r--r--sound/soc/davinci/davinci-mcasp.c4
-rw-r--r--sound/soc/davinci/davinci-sffsdr.c181
4 files changed, 2 insertions, 195 deletions
diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index 9e11a14d1b45..c82f89c9475b 100644
--- a/sound/soc/davinci/Kconfig
+++ b/sound/soc/davinci/Kconfig
@@ -54,16 +54,6 @@ config SND_DM6467_SOC_EVM
54 help 54 help
55 Say Y if you want to add support for SoC audio on TI 55 Say Y if you want to add support for SoC audio on TI
56 56
57config SND_DAVINCI_SOC_SFFSDR
58 tristate "SoC Audio support for SFFSDR"
59 depends on SND_DAVINCI_SOC && MACH_SFFSDR
60 select SND_DAVINCI_SOC_I2S
61 select SND_SOC_PCM3008
62 select SFFSDR_FPGA
63 help
64 Say Y if you want to add support for SoC audio on
65 Lyrtech SFFSDR board.
66
67config SND_DA830_SOC_EVM 57config SND_DA830_SOC_EVM
68 tristate "SoC Audio support for DA830/OMAP-L137 EVM" 58 tristate "SoC Audio support for DA830/OMAP-L137 EVM"
69 depends on SND_DAVINCI_SOC && MACH_DAVINCI_DA830_EVM 59 depends on SND_DAVINCI_SOC && MACH_DAVINCI_DA830_EVM
diff --git a/sound/soc/davinci/Makefile b/sound/soc/davinci/Makefile
index a93679d618cd..a396ab6d6d5e 100644
--- a/sound/soc/davinci/Makefile
+++ b/sound/soc/davinci/Makefile
@@ -11,10 +11,8 @@ obj-$(CONFIG_SND_DAVINCI_SOC_VCIF) += snd-soc-davinci-vcif.o
11 11
12# DAVINCI Machine Support 12# DAVINCI Machine Support
13snd-soc-evm-objs := davinci-evm.o 13snd-soc-evm-objs := davinci-evm.o
14snd-soc-sffsdr-objs := davinci-sffsdr.o
15 14
16obj-$(CONFIG_SND_DAVINCI_SOC_EVM) += snd-soc-evm.o 15obj-$(CONFIG_SND_DAVINCI_SOC_EVM) += snd-soc-evm.o
17obj-$(CONFIG_SND_DM6467_SOC_EVM) += snd-soc-evm.o 16obj-$(CONFIG_SND_DM6467_SOC_EVM) += snd-soc-evm.o
18obj-$(CONFIG_SND_DA830_SOC_EVM) += snd-soc-evm.o 17obj-$(CONFIG_SND_DA830_SOC_EVM) += snd-soc-evm.o
19obj-$(CONFIG_SND_DA850_SOC_EVM) += snd-soc-evm.o 18obj-$(CONFIG_SND_DA850_SOC_EVM) += snd-soc-evm.o
20obj-$(CONFIG_SND_DAVINCI_SOC_SFFSDR) += snd-soc-sffsdr.o
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 81490febac6d..32ddb7fe5034 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1024,7 +1024,7 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
1024 struct device_node *np = pdev->dev.of_node; 1024 struct device_node *np = pdev->dev.of_node;
1025 struct snd_platform_data *pdata = NULL; 1025 struct snd_platform_data *pdata = NULL;
1026 const struct of_device_id *match = 1026 const struct of_device_id *match =
1027 of_match_device(of_match_ptr(mcasp_dt_ids), &pdev->dev); 1027 of_match_device(mcasp_dt_ids, &pdev->dev);
1028 1028
1029 const u32 *of_serial_dir32; 1029 const u32 *of_serial_dir32;
1030 u8 *of_serial_dir; 1030 u8 *of_serial_dir;
@@ -1257,7 +1257,7 @@ static struct platform_driver davinci_mcasp_driver = {
1257 .driver = { 1257 .driver = {
1258 .name = "davinci-mcasp", 1258 .name = "davinci-mcasp",
1259 .owner = THIS_MODULE, 1259 .owner = THIS_MODULE,
1260 .of_match_table = of_match_ptr(mcasp_dt_ids), 1260 .of_match_table = mcasp_dt_ids,
1261 }, 1261 },
1262}; 1262};
1263 1263
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
deleted file mode 100644
index 5be65aae7e0e..000000000000
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * ASoC driver for Lyrtech SFFSDR board.
3 *
4 * Author: Hugo Villeneuve
5 * Copyright (C) 2008 Lyrtech inc
6 *
7 * Based on ASoC driver for TI DAVINCI EVM platform, original copyright follow:
8 * Copyright: (C) 2007 MontaVista Software, Inc., <source@mvista.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/module.h>
16#include <linux/moduleparam.h>
17#include <linux/timer.h>
18#include <linux/interrupt.h>
19#include <linux/platform_device.h>
20#include <linux/gpio.h>
21#include <sound/core.h>
22#include <sound/pcm.h>
23#include <sound/soc.h>
24
25#include <asm/dma.h>
26#include <asm/mach-types.h>
27#ifdef CONFIG_SFFSDR_FPGA
28#include <asm/plat-sffsdr/sffsdr-fpga.h>
29#endif
30
31#include <mach/edma.h>
32
33#include "../codecs/pcm3008.h"
34#include "davinci-pcm.h"
35#include "davinci-i2s.h"
36
37/*
38 * CLKX and CLKR are the inputs for the Sample Rate Generator.
39 * FSX and FSR are outputs, driven by the sample Rate Generator.
40 */
41#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \
42 SND_SOC_DAIFMT_CBM_CFS | \
43 SND_SOC_DAIFMT_IB_NF)
44
45static int sffsdr_hw_params(struct snd_pcm_substream *substream,
46 struct snd_pcm_hw_params *params)
47{
48 struct snd_soc_pcm_runtime *rtd = substream->private_data;
49 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
50 int fs;
51 int ret = 0;
52
53 /* Fsref can be 32000, 44100 or 48000. */
54 fs = params_rate(params);
55
56#ifndef CONFIG_SFFSDR_FPGA
57 /* Without the FPGA module, the Fs is fixed at 44100 Hz */
58 if (fs != 44100) {
59 pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n");
60 return -EINVAL;
61 }
62#endif
63
64 /* set cpu DAI configuration */
65 ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
66 if (ret < 0)
67 return ret;
68
69 pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);
70
71#ifndef CONFIG_SFFSDR_FPGA
72 return 0;
73#else
74 return sffsdr_fpga_set_codec_fs(fs);
75#endif
76}
77
78static struct snd_soc_ops sffsdr_ops = {
79 .hw_params = sffsdr_hw_params,
80};
81
82/* davinci-sffsdr digital audio interface glue - connects codec <--> CPU */
83static struct snd_soc_dai_link sffsdr_dai = {
84 .name = "PCM3008", /* Codec name */
85 .stream_name = "PCM3008 HiFi",
86 .cpu_dai_name = "davinci-mcbsp",
87 .codec_dai_name = "pcm3008-hifi",
88 .codec_name = "pcm3008-codec",
89 .platform_name = "davinci-mcbsp",
90 .ops = &sffsdr_ops,
91};
92
93/* davinci-sffsdr audio machine driver */
94static struct snd_soc_card snd_soc_sffsdr = {
95 .name = "DaVinci SFFSDR",
96 .owner = THIS_MODULE,
97 .dai_link = &sffsdr_dai,
98 .num_links = 1,
99};
100
101/* sffsdr audio private data */
102static struct pcm3008_setup_data sffsdr_pcm3008_setup = {
103 .dem0_pin = GPIO(45),
104 .dem1_pin = GPIO(46),
105 .pdad_pin = GPIO(47),
106 .pdda_pin = GPIO(38),
107};
108
109struct platform_device pcm3008_codec = {
110 .name = "pcm3008-codec",
111 .id = 0,
112 .dev = {
113 .platform_data = &sffsdr_pcm3008_setup,
114 },
115};
116
117static struct resource sffsdr_snd_resources[] = {
118 {
119 .start = DAVINCI_MCBSP_BASE,
120 .end = DAVINCI_MCBSP_BASE + SZ_8K - 1,
121 .flags = IORESOURCE_MEM,
122 },
123};
124
125static struct evm_snd_platform_data sffsdr_snd_data = {
126 .tx_dma_ch = DAVINCI_DMA_MCBSP_TX,
127 .rx_dma_ch = DAVINCI_DMA_MCBSP_RX,
128};
129
130static struct platform_device *sffsdr_snd_device;
131
132static int __init sffsdr_init(void)
133{
134 int ret;
135
136 if (!machine_is_sffsdr())
137 return -EINVAL;
138
139 platform_device_register(&pcm3008_codec);
140
141 sffsdr_snd_device = platform_device_alloc("soc-audio", 0);
142 if (!sffsdr_snd_device) {
143 printk(KERN_ERR "platform device allocation failed\n");
144 return -ENOMEM;
145 }
146
147 platform_set_drvdata(sffsdr_snd_device, &snd_soc_sffsdr);
148 platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data,
149 sizeof(sffsdr_snd_data));
150
151 ret = platform_device_add_resources(sffsdr_snd_device,
152 sffsdr_snd_resources,
153 ARRAY_SIZE(sffsdr_snd_resources));
154 if (ret) {
155 printk(KERN_ERR "platform device add resources failed\n");
156 goto error;
157 }
158
159 ret = platform_device_add(sffsdr_snd_device);
160 if (ret)
161 goto error;
162
163 return ret;
164
165error:
166 platform_device_put(sffsdr_snd_device);
167 return ret;
168}
169
170static void __exit sffsdr_exit(void)
171{
172 platform_device_unregister(sffsdr_snd_device);
173 platform_device_unregister(&pcm3008_codec);
174}
175
176module_init(sffsdr_init);
177module_exit(sffsdr_exit);
178
179MODULE_AUTHOR("Hugo Villeneuve");
180MODULE_DESCRIPTION("Lyrtech SFFSDR ASoC driver");
181MODULE_LICENSE("GPL");