summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2011-05-12 16:26:20 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-12 17:40:05 +0200
commitd5e4b0adf6e694f9a8fb31f51fc381bd8be17eae (patch)
tree2ca174230ab93708e062f7c306ab9e02996e1bbe
parent22de71ba03311cdc1063757c50a1488cb90a1fca (diff)
downloadlinux-d5e4b0adf6e694f9a8fb31f51fc381bd8be17eae.tar.gz
linux-d5e4b0adf6e694f9a8fb31f51fc381bd8be17eae.tar.bz2
linux-d5e4b0adf6e694f9a8fb31f51fc381bd8be17eae.zip
ASoC: DMIC codec - Add input widget
Digital microphones can have some additional elements in their audio path (like microphone bias). An input widget is required for digital microphone CODEC driver to allow external connections in machine drivers. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/dmic.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
index 57e9dac88d38..f9a87737ec16 100644
--- a/sound/soc/codecs/dmic.c
+++ b/sound/soc/codecs/dmic.c
@@ -39,7 +39,31 @@ static struct snd_soc_dai_driver dmic_dai = {
},
};
-static struct snd_soc_codec_driver soc_dmic = {};
+static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = {
+ SND_SOC_DAPM_AIF_OUT("DMIC AIF", "Capture", 0,
+ SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_INPUT("DMic"),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+ {"DMIC AIF", NULL, "DMic"},
+};
+
+static int dmic_probe(struct snd_soc_codec *codec)
+{
+ struct snd_soc_dapm_context *dapm = &codec->dapm;
+
+ snd_soc_dapm_new_controls(dapm, dmic_dapm_widgets,
+ ARRAY_SIZE(dmic_dapm_widgets));
+ snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
+ snd_soc_dapm_new_widgets(dapm);
+
+ return 0;
+}
+
+static struct snd_soc_codec_driver soc_dmic = {
+ .probe = dmic_probe,
+};
static int __devinit dmic_dev_probe(struct platform_device *pdev)
{