aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-06-17 12:20:28 -0400
committerMark Brown <broonie@linaro.org>2013-06-17 12:20:28 -0400
commit5f5eb4efe575734e54f26c34ffffc4b48cdca3aa (patch)
treea5cb60c08f3f7100606886a438f2c981a56d3240
parentd238ffabc5e97c3e330995cf5e04d47279a8ff94 (diff)
parentfc09cfbe3e3535897456c12f37fa83024bdab92d (diff)
Merge remote-tracking branch 'asoc/topic/spear' into asoc-next
-rw-r--r--sound/soc/Kconfig1
-rw-r--r--sound/soc/Makefile1
-rw-r--r--sound/soc/spear/Kconfig9
-rw-r--r--sound/soc/spear/Makefile8
-rw-r--r--sound/soc/spear/spdif_in.c31
-rw-r--r--sound/soc/spear/spdif_out.c43
-rw-r--r--sound/soc/spear/spear_pcm.c152
7 files changed, 52 insertions, 193 deletions
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index 9e675c76436c..45eeaa9f7fec 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -51,6 +51,7 @@ source "sound/soc/pxa/Kconfig"
51source "sound/soc/samsung/Kconfig" 51source "sound/soc/samsung/Kconfig"
52source "sound/soc/s6000/Kconfig" 52source "sound/soc/s6000/Kconfig"
53source "sound/soc/sh/Kconfig" 53source "sound/soc/sh/Kconfig"
54source "sound/soc/spear/Kconfig"
54source "sound/soc/tegra/Kconfig" 55source "sound/soc/tegra/Kconfig"
55source "sound/soc/txx9/Kconfig" 56source "sound/soc/txx9/Kconfig"
56source "sound/soc/ux500/Kconfig" 57source "sound/soc/ux500/Kconfig"
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index 197b6ae54c8d..bc0261476d7a 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_SND_SOC) += pxa/
29obj-$(CONFIG_SND_SOC) += samsung/ 29obj-$(CONFIG_SND_SOC) += samsung/
30obj-$(CONFIG_SND_SOC) += s6000/ 30obj-$(CONFIG_SND_SOC) += s6000/
31obj-$(CONFIG_SND_SOC) += sh/ 31obj-$(CONFIG_SND_SOC) += sh/
32obj-$(CONFIG_SND_SOC) += spear/
32obj-$(CONFIG_SND_SOC) += tegra/ 33obj-$(CONFIG_SND_SOC) += tegra/
33obj-$(CONFIG_SND_SOC) += txx9/ 34obj-$(CONFIG_SND_SOC) += txx9/
34obj-$(CONFIG_SND_SOC) += ux500/ 35obj-$(CONFIG_SND_SOC) += ux500/
diff --git a/sound/soc/spear/Kconfig b/sound/soc/spear/Kconfig
new file mode 100644
index 000000000000..3567d73b218e
--- /dev/null
+++ b/sound/soc/spear/Kconfig
@@ -0,0 +1,9 @@
1config SND_SPEAR_SOC
2 tristate
3 select SND_SOC_DMAENGINE_PCM
4
5config SND_SPEAR_SPDIF_OUT
6 tristate
7
8config SND_SPEAR_SPDIF_IN
9 tristate
diff --git a/sound/soc/spear/Makefile b/sound/soc/spear/Makefile
new file mode 100644
index 000000000000..c4ea7161056c
--- /dev/null
+++ b/sound/soc/spear/Makefile
@@ -0,0 +1,8 @@
1# SPEAR Platform Support
2snd-soc-spear-pcm-objs := spear_pcm.o
3snd-soc-spear-spdif-in-objs := spdif_in.o
4snd-soc-spear-spdif-out-objs := spdif_out.o
5
6obj-$(CONFIG_SND_SPEAR_SOC) += snd-soc-spear-pcm.o
7obj-$(CONFIG_SND_SPEAR_SPDIF_IN) += snd-soc-spear-spdif-in.o
8obj-$(CONFIG_SND_SPEAR_SPDIF_OUT) += snd-soc-spear-spdif-out.o
diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c
index 14d57e89bcba..63acfeb4b69d 100644
--- a/sound/soc/spear/spdif_in.c
+++ b/sound/soc/spear/spdif_in.c
@@ -49,15 +49,12 @@ static void spdif_in_configure(struct spdif_in_dev *host)
49 writel(0xF, host->io_base + SPDIF_IN_IRQ_MASK); 49 writel(0xF, host->io_base + SPDIF_IN_IRQ_MASK);
50} 50}
51 51
52static int spdif_in_startup(struct snd_pcm_substream *substream, 52static int spdif_in_dai_probe(struct snd_soc_dai *dai)
53 struct snd_soc_dai *cpu_dai)
54{ 53{
55 struct spdif_in_dev *host = snd_soc_dai_get_drvdata(cpu_dai); 54 struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai);
56 55
57 if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) 56 dai->capture_dma_data = &host->dma_params;
58 return -EINVAL;
59 57
60 snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)&host->dma_params);
61 return 0; 58 return 0;
62} 59}
63 60
@@ -70,7 +67,6 @@ static void spdif_in_shutdown(struct snd_pcm_substream *substream,
70 return; 67 return;
71 68
72 writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK); 69 writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK);
73 snd_soc_dai_set_dma_data(dai, substream, NULL);
74} 70}
75 71
76static void spdif_in_format(struct spdif_in_dev *host, u32 format) 72static void spdif_in_format(struct spdif_in_dev *host, u32 format)
@@ -151,13 +147,13 @@ static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd,
151} 147}
152 148
153static struct snd_soc_dai_ops spdif_in_dai_ops = { 149static struct snd_soc_dai_ops spdif_in_dai_ops = {
154 .startup = spdif_in_startup,
155 .shutdown = spdif_in_shutdown, 150 .shutdown = spdif_in_shutdown,
156 .trigger = spdif_in_trigger, 151 .trigger = spdif_in_trigger,
157 .hw_params = spdif_in_hw_params, 152 .hw_params = spdif_in_hw_params,
158}; 153};
159 154
160struct snd_soc_dai_driver spdif_in_dai = { 155static struct snd_soc_dai_driver spdif_in_dai = {
156 .probe = spdif_in_dai_probe,
161 .capture = { 157 .capture = {
162 .channels_min = 2, 158 .channels_min = 2,
163 .channels_max = 2, 159 .channels_max = 2,
@@ -235,7 +231,7 @@ static int spdif_in_probe(struct platform_device *pdev)
235 if (host->irq < 0) 231 if (host->irq < 0)
236 return -EINVAL; 232 return -EINVAL;
237 233
238 host->clk = clk_get(&pdev->dev, NULL); 234 host->clk = devm_clk_get(&pdev->dev, NULL);
239 if (IS_ERR(host->clk)) 235 if (IS_ERR(host->clk))
240 return PTR_ERR(host->clk); 236 return PTR_ERR(host->clk);
241 237
@@ -257,34 +253,21 @@ static int spdif_in_probe(struct platform_device *pdev)
257 ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0, 253 ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0,
258 "spdif-in", host); 254 "spdif-in", host);
259 if (ret) { 255 if (ret) {
260 clk_put(host->clk);
261 dev_warn(&pdev->dev, "request_irq failed\n"); 256 dev_warn(&pdev->dev, "request_irq failed\n");
262 return ret; 257 return ret;
263 } 258 }
264 259
265 ret = snd_soc_register_component(&pdev->dev, &spdif_in_component, 260 return snd_soc_register_component(&pdev->dev, &spdif_in_component,
266 &spdif_in_dai, 1); 261 &spdif_in_dai, 1);
267 if (ret != 0) {
268 clk_put(host->clk);
269 return ret;
270 }
271
272 return 0;
273} 262}
274 263
275static int spdif_in_remove(struct platform_device *pdev) 264static int spdif_in_remove(struct platform_device *pdev)
276{ 265{
277 struct spdif_in_dev *host = dev_get_drvdata(&pdev->dev);
278
279 snd_soc_unregister_component(&pdev->dev); 266 snd_soc_unregister_component(&pdev->dev);
280 dev_set_drvdata(&pdev->dev, NULL);
281
282 clk_put(host->clk);
283 267
284 return 0; 268 return 0;
285} 269}
286 270
287
288static struct platform_driver spdif_in_driver = { 271static struct platform_driver spdif_in_driver = {
289 .probe = spdif_in_probe, 272 .probe = spdif_in_probe,
290 .remove = spdif_in_remove, 273 .remove = spdif_in_remove,
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index 1e3c3dda3598..2fdf68c98d22 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -62,8 +62,6 @@ static int spdif_out_startup(struct snd_pcm_substream *substream,
62 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 62 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
63 return -EINVAL; 63 return -EINVAL;
64 64
65 snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)&host->dma_params);
66
67 ret = clk_enable(host->clk); 65 ret = clk_enable(host->clk);
68 if (ret) 66 if (ret)
69 return ret; 67 return ret;
@@ -84,7 +82,6 @@ static void spdif_out_shutdown(struct snd_pcm_substream *substream,
84 82
85 clk_disable(host->clk); 83 clk_disable(host->clk);
86 host->running = false; 84 host->running = false;
87 snd_soc_dai_set_dma_data(dai, substream, NULL);
88} 85}
89 86
90static void spdif_out_clock(struct spdif_out_dev *host, u32 core_freq, 87static void spdif_out_clock(struct spdif_out_dev *host, u32 core_freq,
@@ -243,8 +240,12 @@ static const struct snd_kcontrol_new spdif_out_controls[] = {
243 spdif_mute_get, spdif_mute_put), 240 spdif_mute_get, spdif_mute_put),
244}; 241};
245 242
246int spdif_soc_dai_probe(struct snd_soc_dai *dai) 243static int spdif_soc_dai_probe(struct snd_soc_dai *dai)