From: Vinod Koul Date: Thu, 6 Oct 2011 15:18:33 +0000 (+0100) Subject: ASoC: sn95031: enable the DMIC bias X-Git-Tag: 2.1b_release~1980 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=754a6399169973ac7a8d2a1050cf41dab2e762ef;p=kernel%2Fkernel-mfld-blackbay.git ASoC: sn95031: enable the DMIC bias this patch enables the digital mic bias when the digital mics are in use Change-Id: I5283b7369d3610f0fafcbdb4d869055f0caeddb8 Signed-off-by: Vinod Koul --- diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c index e80e0b0..3d24575 100644 --- a/sound/soc/codecs/sn95031.c +++ b/sound/soc/codecs/sn95031.c @@ -219,47 +219,64 @@ static int sn95031_vihf_event(struct snd_soc_dapm_widget *w, static int sn95031_dmic12_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { - unsigned int ldo = 0, clk_dir = 0, data_dir = 0; + unsigned int ldo = 0, clk_dir = 0, data_dir = 0, bias = 0; + pr_debug("sn95031_dmic12_event\n"); if (SND_SOC_DAPM_EVENT_ON(event)) { + pr_debug("sn95031_dmic12_eventi ON\n"); ldo = BIT(5)|BIT(4); clk_dir = BIT(0); data_dir = BIT(7); + bias = BIT(3); } /* program DMIC LDO, clock and set clock */ snd_soc_update_bits(w->codec, SN95031_MICBIAS, BIT(5)|BIT(4), ldo); snd_soc_update_bits(w->codec, SN95031_DMICBUF0123, BIT(0), clk_dir); snd_soc_update_bits(w->codec, SN95031_DMICBUF0123, BIT(7), data_dir); + snd_soc_update_bits(w->codec, SN95031_DMICMUX, BIT(3), bias); return 0; } static int sn95031_dmic34_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { - unsigned int ldo = 0, clk_dir = 0, data_dir = 0; + unsigned int ldo = 0, clk_dir = 0, data_dir = 0, bias = 0; + pr_debug("sn95031_dmic34_event\n"); if (SND_SOC_DAPM_EVENT_ON(event)) { + pr_debug("sn95031_dmic34_event ON\n"); ldo = BIT(5)|BIT(4); clk_dir = BIT(2); data_dir = BIT(1); + bias = BIT(4); } /* program DMIC LDO, clock and set clock */ snd_soc_update_bits(w->codec, SN95031_MICBIAS, BIT(5)|BIT(4), ldo); snd_soc_update_bits(w->codec, SN95031_DMICBUF0123, BIT(2), clk_dir); snd_soc_update_bits(w->codec, SN95031_DMICBUF45, BIT(1), data_dir); + snd_soc_update_bits(w->codec, SN95031_DMICMUX, BIT(4), bias); return 0; } static int sn95031_dmic56_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { - unsigned int ldo = 0; + unsigned int ldo = 0, clk_dir = 0, data_dir = 0, bias = 0; - if (SND_SOC_DAPM_EVENT_ON(event)) + pr_debug("sn95031_dmic56_event\n"); + if (SND_SOC_DAPM_EVENT_ON(event)) { + pr_debug("sn95031_dmic56_event ON\n"); ldo = BIT(7)|BIT(6); + clk_dir = BIT(4); + data_dir = BIT(3); + bias = BIT(5); + } /* program DMIC LDO */ snd_soc_update_bits(w->codec, SN95031_MICBIAS, BIT(7)|BIT(6), ldo); + snd_soc_update_bits(w->codec, SN95031_DMICBUF0123, BIT(4), clk_dir); + snd_soc_update_bits(w->codec, SN95031_DMICBUF45, BIT(3), data_dir); + snd_soc_update_bits(w->codec, SN95031_DMICMUX, BIT(5), bias); return 0; }