aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-08 03:49:42 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-11 16:34:13 -0400
commit4bb3f43c6e3f3f6897f60ee1bab423ce23539d2c (patch)
tree8fa55f93e57094891d8a411c0aba22aef12d0d3e /sound
parentc93993aca45a223452d2a95383b655c85878c6e8 (diff)
ASoC: Add initial WM1250-EV1 Springbank audio I/O module driver
The WM1250-EV1 Springbank audio I/O module for the Wolfson Glenfarclas reference platform provides a simple audio I/O with an independant clock domain, intended to simulate cellular modem and bluetooth subsystems within the platform. The card supports some limited GPIO based control but this is currently not implemented. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/Kconfig4
-rw-r--r--sound/soc/codecs/Makefile2
-rw-r--r--sound/soc/codecs/wm1250-ev1.c108
3 files changed, 114 insertions, 0 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 54d5dd6c63a..2a6971891d3 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -53,6 +53,7 @@ config SND_SOC_ALL_CODECS
53 select SND_SOC_UDA134X 53 select SND_SOC_UDA134X
54 select SND_SOC_UDA1380 if I2C 54 select SND_SOC_UDA1380 if I2C
55 select SND_SOC_WL1273 if MFD_WL1273_CORE 55 select SND_SOC_WL1273 if MFD_WL1273_CORE
56 select SND_SOC_WM1250_EV1 if I2C
56 select SND_SOC_WM2000 if I2C 57 select SND_SOC_WM2000 if I2C
57 select SND_SOC_WM8350 if MFD_WM8350 58 select SND_SOC_WM8350 if MFD_WM8350
58 select SND_SOC_WM8400 if MFD_WM8400 59 select SND_SOC_WM8400 if MFD_WM8400
@@ -246,6 +247,9 @@ config SND_SOC_UDA1380
246config SND_SOC_WL1273 247config SND_SOC_WL1273
247 tristate 248 tristate
248 249
250config SND_SOC_WM1250_EV1
251 tristate
252
249config SND_SOC_WM8350 253config SND_SOC_WM8350
250 tristate 254 tristate
251 255
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 02425e6a87e..4cb2f42dbff 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -38,6 +38,7 @@ snd-soc-twl6040-objs := twl6040.o
38snd-soc-uda134x-objs := uda134x.o 38snd-soc-uda134x-objs := uda134x.o
39snd-soc-uda1380-objs := uda1380.o 39snd-soc-uda1380-objs := uda1380.o
40snd-soc-wl1273-objs := wl1273.o 40snd-soc-wl1273-objs := wl1273.o
41snd-soc-wm1250-ev1-objs := wm1250-ev1.o
41snd-soc-wm8350-objs := wm8350.o 42snd-soc-wm8350-objs := wm8350.o
42snd-soc-wm8400-objs := wm8400.o 43snd-soc-wm8400-objs := wm8400.o
43snd-soc-wm8510-objs := wm8510.o 44snd-soc-wm8510-objs := wm8510.o
@@ -128,6 +129,7 @@ obj-$(CONFIG_SND_SOC_TWL6040) += snd-soc-twl6040.o
128obj-$(CONFIG_SND_SOC_UDA134X) += snd-soc-uda134x.o 129obj-$(CONFIG_SND_SOC_UDA134X) += snd-soc-uda134x.o
129obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o 130obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
130obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o 131obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o
132obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o
131obj-$(CONFIG_SND_SOC_WM8350) += snd-soc-wm8350.o 133obj-$(CONFIG_SND_SOC_WM8350) += snd-soc-wm8350.o
132obj-$(CONFIG_SND_SOC_WM8400) += snd-soc-wm8400.o 134obj-$(CONFIG_SND_SOC_WM8400) += snd-soc-wm8400.o
133obj-$(CONFIG_SND_SOC_WM8510) += snd-soc-wm8510.o 135obj-$(CONFIG_SND_SOC_WM8510) += snd-soc-wm8510.o
diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c
new file mode 100644
index 00000000000..9cf699e165e
--- /dev/null
+++ b/sound/soc/codecs/wm1250-ev1.c
@@ -0,0 +1,108 @@
1/*
2 * Driver for the 1250-EV1 audio I/O module
3 *
4 * Copyright 2011 Wolfson Microelectronics plc
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
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/i2c.h>
16
17#include <sound/soc.h>
18#include <sound/soc-dapm.h>
19
20static const struct snd_soc_dapm_widget wm1250_ev1_dapm_widgets[] = {
21SND_SOC_DAPM_ADC("ADC", "wm1250-ev1 Capture", SND_SOC_NOPM, 0, 0),
22SND_SOC_DAPM_DAC("DAC", "wm1250-ev1 Playback", SND_SOC_NOPM, 0, 0),
23
24SND_SOC_DAPM_INPUT("WM1250 Input"),
25SND_SOC_DAPM_INPUT("WM1250 Output"),
26};
27
28static const struct snd_soc_dapm_route wm1250_ev1_dapm_routes[] = {
29 { "ADC", NULL, "WM1250 Input" },
30 { "WM1250 Output", NULL, "DAC" },
31};
32
33static struct snd_soc_dai_driver wm1250_ev1_dai = {
34 .name = "wm1250-ev1",
35 .playback = {
36 .stream_name = "Playback",
37 .channels_min = 1,
38 .channels_max = 1,
39 .rates = SNDRV_PCM_RATE_8000,
40 .formats = SNDRV_PCM_FMTBIT_S16_LE,
41 },
42 .capture = {
43 .stream_name = "Capture",
44 .channels_min = 1,
45 .channels_max = 1,
46 .rates = SNDRV_PCM_RATE_8000,
47 .formats = SNDRV_PCM_FMTBIT_S16_LE,
48 },
49};
50
51static struct snd_soc_codec_driver soc_codec_dev_wm1250_ev1 = {
52 .dapm_widgets = wm1250_ev1_dapm_widgets,
53 .num_dapm_widgets = ARRAY_SIZE(wm1250_ev1_dapm_widgets),
54 .dapm_routes = wm1250_ev1_dapm_routes,
55 .num_dapm_routes = ARRAY_SIZE(wm1250_ev1_dapm_routes),
56};
57
58static int __devinit wm1250_ev1_probe(struct i2c_client *i2c,
59 const struct i2c_device_id *id)
60{
61 return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm1250_ev1,
62 &wm1250_ev1_dai, 1);
63}
64
65static int __devexit wm1250_ev1_remove(struct i2c_client *i2c)
66{
67 snd_soc_unregister_codec(&i2c->dev);
68
69 return 0;
70}
71
72static const struct i2c_device_id wm1250_ev1_i2c_id[] = {
73 { "wm1250-ev1", 0 },
74 { }
75};
76MODULE_DEVICE_TABLE(i2c, wm1250_ev1__id);
77
78static struct i2c_driver wm1250_ev1_i2c_driver = {
79 .driver = {
80 .name = "wm1250-ev1",
81 .owner = THIS_MODULE,
82 },
83 .probe = wm1250_ev1_probe,
84 .remove = __devexit_p(wm1250_ev1_remove),
85 .id_table = wm1250_ev1_i2c_id,
86};
87
88static int __init wm1250_ev1_modinit(void)
89{
90 int ret = 0;
91
92 ret = i2c_add_driver(&wm1250_ev1_i2c_driver);
93 if (ret != 0)
94 pr_err("Failed to register WM1250-EV1 I2C driver: %d\n", ret);
95
96 return ret;
97}
98module_init(wm1250_ev1_modinit);
99
100static void __exit wm1250_ev1_exit(void)
101{
102 i2c_del_driver(&wm1250_ev1_i2c_driver);
103}
104module_exit(wm1250_ev1_exit);
105
106MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
107MODULE_DESCRIPTION("WM1250-EV1 audio I/O module driver");
108MODULE_LICENSE("GPL");