diff options
author | Misael Lopez Cruz <misael.lopez@ti.com> | 2011-12-02 09:58:32 +0800 |
---|---|---|
committer | Sebastien Jan <s-jan@ti.com> | 2011-12-05 11:20:25 +0100 |
commit | 34c966895501632c8ab385a276558a68e7d43f6f (patch) | |
tree | 807694ce3861789b7dcec5a372fa008e67892b2c /sound | |
parent | 3e121884be76a91e28114bdece8493d82cc0e0c6 (diff) |
ASoC: sdp4430 - Add Mic Bias for digital mics in legacy mode
Add microphone bias for digital microphone in legacy mode.
Change-Id: Idc37babbf7acd552c6fbefe51315492e861116eb
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/omap/sdp4430.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index 8af88f53cf97..700323e50160 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -335,6 +335,39 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) return ret; } +/* SDP4430 digital microphones DAPM */ +static const struct snd_soc_dapm_widget sdp4430_dmic_dapm_widgets[] = { + SND_SOC_DAPM_MIC("Digital Mic Legacy", NULL), +}; + +static const struct snd_soc_dapm_route dmic_audio_map[] = { + {"DMic", NULL, "Digital Mic1 Bias"}, + {"Digital Mic1 Bias", NULL, "Digital Mic Legacy"}, +}; + +static int sdp4430_dmic_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_dapm_context *dapm = &codec->dapm; + int ret; + + ret = snd_soc_dapm_new_controls(dapm, sdp4430_dmic_dapm_widgets, + ARRAY_SIZE(sdp4430_dmic_dapm_widgets)); + if (ret) + return ret; + + ret = snd_soc_dapm_add_routes(dapm, dmic_audio_map, + ARRAY_SIZE(dmic_audio_map)); + if (ret) + return ret; + + snd_soc_dapm_enable_pin(dapm, "Digital Mic Legacy"); + + ret = snd_soc_dapm_sync(dapm); + + return ret; +} + /* TODO: make this a separate BT CODEC driver or DUMMY */ static struct snd_soc_dai_driver dai[] = { { @@ -551,6 +584,7 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_dai_name = "dmic-hifi", .codec_name = "dmic-codec.0", + .init = sdp4430_dmic_init, .ops = &sdp4430_dmic_ops, }, |