Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248273
b: refs/heads/master
c: 4bb3f43
h: refs/heads/master
i:
  248271: f835492
v: v3
  • Loading branch information
Mark Brown committed Apr 11, 2011
1 parent e23c196 commit 6c46b20
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c93993aca45a223452d2a95383b655c85878c6e8
refs/heads/master: 4bb3f43c6e3f3f6897f60ee1bab423ce23539d2c
4 changes: 4 additions & 0 deletions trunk/sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WL1273 if MFD_WL1273_CORE
select SND_SOC_WM1250_EV1 if I2C
select SND_SOC_WM2000 if I2C
select SND_SOC_WM8350 if MFD_WM8350
select SND_SOC_WM8400 if MFD_WM8400
Expand Down Expand Up @@ -246,6 +247,9 @@ config SND_SOC_UDA1380
config SND_SOC_WL1273
tristate

config SND_SOC_WM1250_EV1
tristate

config SND_SOC_WM8350
tristate

Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ snd-soc-twl6040-objs := twl6040.o
snd-soc-uda134x-objs := uda134x.o
snd-soc-uda1380-objs := uda1380.o
snd-soc-wl1273-objs := wl1273.o
snd-soc-wm1250-ev1-objs := wm1250-ev1.o
snd-soc-wm8350-objs := wm8350.o
snd-soc-wm8400-objs := wm8400.o
snd-soc-wm8510-objs := wm8510.o
Expand Down Expand Up @@ -128,6 +129,7 @@ obj-$(CONFIG_SND_SOC_TWL6040) += snd-soc-twl6040.o
obj-$(CONFIG_SND_SOC_UDA134X) += snd-soc-uda134x.o
obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o
obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o
obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o
obj-$(CONFIG_SND_SOC_WM8350) += snd-soc-wm8350.o
obj-$(CONFIG_SND_SOC_WM8400) += snd-soc-wm8400.o
obj-$(CONFIG_SND_SOC_WM8510) += snd-soc-wm8510.o
Expand Down
108 changes: 108 additions & 0 deletions trunk/sound/soc/codecs/wm1250-ev1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Driver for the 1250-EV1 audio I/O module
*
* Copyright 2011 Wolfson Microelectronics plc
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
*/

#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>

#include <sound/soc.h>
#include <sound/soc-dapm.h>

static const struct snd_soc_dapm_widget wm1250_ev1_dapm_widgets[] = {
SND_SOC_DAPM_ADC("ADC", "wm1250-ev1 Capture", SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_DAC("DAC", "wm1250-ev1 Playback", SND_SOC_NOPM, 0, 0),

SND_SOC_DAPM_INPUT("WM1250 Input"),
SND_SOC_DAPM_INPUT("WM1250 Output"),
};

static const struct snd_soc_dapm_route wm1250_ev1_dapm_routes[] = {
{ "ADC", NULL, "WM1250 Input" },
{ "WM1250 Output", NULL, "DAC" },
};

static struct snd_soc_dai_driver wm1250_ev1_dai = {
.name = "wm1250-ev1",
.playback = {
.stream_name = "Playback",
.channels_min = 1,
.channels_max = 1,
.rates = SNDRV_PCM_RATE_8000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "Capture",
.channels_min = 1,
.channels_max = 1,
.rates = SNDRV_PCM_RATE_8000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
};

static struct snd_soc_codec_driver soc_codec_dev_wm1250_ev1 = {
.dapm_widgets = wm1250_ev1_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm1250_ev1_dapm_widgets),
.dapm_routes = wm1250_ev1_dapm_routes,
.num_dapm_routes = ARRAY_SIZE(wm1250_ev1_dapm_routes),
};

static int __devinit wm1250_ev1_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm1250_ev1,
&wm1250_ev1_dai, 1);
}

static int __devexit wm1250_ev1_remove(struct i2c_client *i2c)
{
snd_soc_unregister_codec(&i2c->dev);

return 0;
}

static const struct i2c_device_id wm1250_ev1_i2c_id[] = {
{ "wm1250-ev1", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, wm1250_ev1__id);

static struct i2c_driver wm1250_ev1_i2c_driver = {
.driver = {
.name = "wm1250-ev1",
.owner = THIS_MODULE,
},
.probe = wm1250_ev1_probe,
.remove = __devexit_p(wm1250_ev1_remove),
.id_table = wm1250_ev1_i2c_id,
};

static int __init wm1250_ev1_modinit(void)
{
int ret = 0;

ret = i2c_add_driver(&wm1250_ev1_i2c_driver);
if (ret != 0)
pr_err("Failed to register WM1250-EV1 I2C driver: %d\n", ret);

return ret;
}
module_init(wm1250_ev1_modinit);

static void __exit wm1250_ev1_exit(void)
{
i2c_del_driver(&wm1250_ev1_i2c_driver);
}
module_exit(wm1250_ev1_exit);

MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("WM1250-EV1 audio I/O module driver");
MODULE_LICENSE("GPL");

0 comments on commit 6c46b20

Please sign in to comment.