aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-12 20:24:39 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-13 13:01:30 -0400
commit9b8dc66fbae53def2547df8c0a5cbe8924ea2b1f (patch)
tree3c2779977e2e2d5c5e63477df21e44838c69e46d /sound/soc/samsung
parent9a841ebb9cac3f1b7253bb01c304f89b1af25aba (diff)
ASoC: Initial audio support for Speyside on Cragganmore 6410
This is minimal code required to get audio out of the Speyside audio subsystem on the Wolfson Cragganmore 6410 reference platform. It sets up the link between the CPU and AIF1 of the WM8915 on the system, enabling audio playback via the headphone and speaker outputs of the device (which require no further configuration except runtime). It allows verification of basic functionality of the system. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/Kconfig6
-rw-r--r--sound/soc/samsung/Makefile2
-rw-r--r--sound/soc/samsung/speyside.c123
3 files changed, 131 insertions, 0 deletions
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index b8c7a2e0d21c..726af2ede795 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -170,3 +170,9 @@ config SND_SOC_SMDK_WM8580_PCM
170 select SND_SAMSUNG_PCM 170 select SND_SAMSUNG_PCM
171 help 171 help
172 Say Y if you want to add support for SoC audio on the SMDK. 172 Say Y if you want to add support for SoC audio on the SMDK.
173
174config SND_SOC_SPEYSIDE
175 tristate "Audio support for Wolfson Speyside"
176 depends on SND_SOC_SAMSUNG && MACH_WLF_CRAGG_6410
177 select SND_SAMSUNG_I2S
178 select SND_SOC_WM8915
diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile
index 6c598fc51a01..683843a2744f 100644
--- a/sound/soc/samsung/Makefile
+++ b/sound/soc/samsung/Makefile
@@ -35,6 +35,7 @@ snd-soc-s3c64xx-smartq-wm8987-objs := smartq_wm8987.o
35snd-soc-goni-wm8994-objs := goni_wm8994.o 35snd-soc-goni-wm8994-objs := goni_wm8994.o
36snd-soc-smdk-spdif-objs := smdk_spdif.o 36snd-soc-smdk-spdif-objs := smdk_spdif.o
37snd-soc-smdk-wm8580pcm-objs := smdk_wm8580pcm.o 37snd-soc-smdk-wm8580pcm-objs := smdk_wm8580pcm.o
38snd-soc-speyside-objs := speyside.o
38 39
39obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o 40obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o
40obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o 41obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
@@ -53,3 +54,4 @@ obj-$(CONFIG_SND_SOC_SMARTQ) += snd-soc-s3c64xx-smartq-wm8987.o
53obj-$(CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF) += snd-soc-smdk-spdif.o 54obj-$(CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF) += snd-soc-smdk-spdif.o
54obj-$(CONFIG_SND_SOC_GONI_AQUILA_WM8994) += snd-soc-goni-wm8994.o 55obj-$(CONFIG_SND_SOC_GONI_AQUILA_WM8994) += snd-soc-goni-wm8994.o
55obj-$(CONFIG_SND_SOC_SMDK_WM8580_PCM) += snd-soc-smdk-wm8580pcm.o 56obj-$(CONFIG_SND_SOC_SMDK_WM8580_PCM) += snd-soc-smdk-wm8580pcm.o
57obj-$(CONFIG_SND_SOC_SPEYSIDE) += snd-soc-speyside.o
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c
new file mode 100644
index 000000000000..f6dcee7b218b
--- /dev/null
+++ b/sound/soc/samsung/speyside.c
@@ -0,0 +1,123 @@
1/*
2 * Speyside audio support
3 *
4 * Copyright 2011 Wolfson Microelectronics
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <sound/soc.h>
13#include <sound/soc-dapm.h>
14
15#include "../codecs/wm8915.h"
16
17static int speyside_hw_params(struct snd_pcm_substream *substream,
18 struct snd_pcm_hw_params *params)
19{
20 struct snd_soc_pcm_runtime *rtd = substream->private_data;
21 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
22 struct snd_soc_dai *codec_dai = rtd->codec_dai;
23 int ret;
24
25 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S
26 | SND_SOC_DAIFMT_NB_NF
27 | SND_SOC_DAIFMT_CBM_CFM);
28 if (ret < 0)
29 return ret;
30
31 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S
32 | SND_SOC_DAIFMT_NB_NF
33 | SND_SOC_DAIFMT_CBM_CFM);
34 if (ret < 0)
35 return ret;
36
37 ret = snd_soc_dai_set_pll(codec_dai, 0, WM8915_FLL_MCLK1,
38 32768, 256 * 48000);
39 if (ret < 0)
40 return ret;
41
42 ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_FLL,
43 256 * 48000, SND_SOC_CLOCK_IN);
44 if (ret < 0)
45 return ret;
46
47 return 0;
48}
49
50static struct snd_soc_ops speyside_ops = {
51 .hw_params = speyside_hw_params,
52};
53
54static struct snd_soc_dai_link speyside_dai[] = {
55 {
56 .name = "CPU",
57 .stream_name = "CPU",
58 .cpu_dai_name = "samsung-i2s.0",
59 .codec_dai_name = "wm8915-aif1",
60 .platform_name = "samsung-audio",
61 .codec_name = "wm8915.1-001a",
62 .ops = &speyside_ops,
63 },
64};
65
66static struct snd_soc_card speyside = {
67 .name = "Speyside",
68 .dai_link = speyside_dai,
69 .num_links = ARRAY_SIZE(speyside_dai),
70};
71
72static __devinit int speyside_probe(struct platform_device *pdev)
73{
74 struct snd_soc_card *card = &speyside;
75 int ret;
76
77 card->dev = &pdev->dev;
78
79 ret = snd_soc_register_card(card);
80 if (ret) {
81 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
82 ret);
83 return ret;
84 }
85
86 return 0;
87}
88
89static int __devexit speyside_remove(struct platform_device *pdev)
90{
91 struct snd_soc_card *card = platform_get_drvdata(pdev);
92
93 snd_soc_unregister_card(card);
94
95 return 0;
96}
97
98static struct platform_driver speyside_driver = {
99 .driver = {
100 .name = "speyside",
101 .owner = THIS_MODULE,
102 .pm = &snd_soc_pm_ops,
103 },
104 .probe = speyside_probe,
105 .remove = __devexit_p(speyside_remove),
106};
107
108static int __init speyside_audio_init(void)
109{
110 return platform_driver_register(&speyside_driver);
111}
112module_init(speyside_audio_init);
113
114static void __exit speyside_audio_exit(void)
115{
116 platform_driver_unregister(&speyside_driver);
117}
118module_exit(speyside_audio_exit);
119
120MODULE_DESCRIPTION("Speyside audio support");
121MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
122MODULE_LICENSE("GPL");
123MODULE_ALIAS("platform:speyside");