ASoC: DMIC codec - Add input widget
PATCH 1/1 ASoC: DMIC codec - Add input widget
From: Misael Lopez Cruz <[email protected]>
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.
Change-Id Ice9fcb2dbe9acccd859f90ae875d2280926bf08a
Signed-off-by Misael Lopez Cruz <[email protected]>
Signed-off-by Liam Girdwood <[email protected]>
--- sound/soc/codecs/dmic.c | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-)
sound/soc/codecs/dmic.c +25 -1
@@ -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) {
Signature · 1 line
1.7.4.1
Mark Brown
AppliedQuoted 8 lines · Liam Girdwood
From: Misael Lopez Cruz <[email protected]>
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.
Change-Id: Ice9fcb2dbe9acccd859f90ae875d2280926bf08a
Applied, with the Change-Id stripped out.