diff options
author | Bhalchandra Gajare <gajare@codeaurora.org> | 2017-04-05 14:32:16 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-11 18:16:40 -0700 |
commit | 9e58aeb33e39b17f9289958688681886cd002996 (patch) | |
tree | de5c24ccd315a4659fdb471f1cc8477cc01f75f7 /sound | |
parent | 1c450066c7c30a84ab95adc8674833508418e4a3 (diff) |
ASoC: wcd934x: use analog mics in micbias mode for MAD
It is possible to route analog microphone data to the MAD (Microphone
Activity Detection) block in the codec. Currently, VDDIO mode is used
for analog microphones, which can cause degradation of audio data,
causing no detection from the MAD block. Change the MAD programming
to use micbias instead of VDDIO mode for analog microphones to fix
this signal degradation problem.
CRs-fixed: 2021869
Change-Id: I77e089bd9858e5179405f87982b16ddaf7b4cd5b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wcd934x/wcd934x.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/wcd934x/wcd934x.c b/sound/soc/codecs/wcd934x/wcd934x.c index e125ed8c2a16..230ff699c1a7 100644 --- a/sound/soc/codecs/wcd934x/wcd934x.c +++ b/sound/soc/codecs/wcd934x/wcd934x.c @@ -5476,7 +5476,7 @@ static int tavil_mad_input_put(struct snd_kcontrol *kcontrol, u32 adc, i, mic_bias_found = 0; int ret = 0; char *mad_input; - bool is_adc2_input = false; + bool is_adc_input = false; tavil_mad_input = ucontrol->value.integer.value[0]; @@ -5524,8 +5524,7 @@ static int tavil_mad_input_put(struct snd_kcontrol *kcontrol, snprintf(mad_amic_input_widget, 6, "%s%u", "AMIC", adc); mad_input_widget = mad_amic_input_widget; - if (adc == 2) - is_adc2_input = true; + is_adc_input = true; } else { /* DMIC type input widget*/ mad_input_widget = tavil_conn_mad_text[tavil_mad_input]; @@ -5533,7 +5532,7 @@ static int tavil_mad_input_put(struct snd_kcontrol *kcontrol, dev_dbg(codec->dev, "%s: tavil input widget = %s, adc_input = %s\n", __func__, - mad_input_widget, is_adc2_input ? "true" : "false"); + mad_input_widget, is_adc_input ? "true" : "false"); for (i = 0; i < card->num_of_dapm_routes; i++) { if (!strcmp(card->of_dapm_routes[i].sink, mad_input_widget)) { @@ -5578,8 +5577,8 @@ static int tavil_mad_input_put(struct snd_kcontrol *kcontrol, 0x0F, tavil_mad_input); snd_soc_update_bits(codec, WCD934X_ANA_MAD_SETUP, 0x07, mic_bias_found); - /* for adc2 input, mad should be in micbias mode with BG enabled */ - if (is_adc2_input) + /* for all adc inputs, mad should be in micbias mode with BG enabled */ + if (is_adc_input) snd_soc_update_bits(codec, WCD934X_ANA_MAD_SETUP, 0x88, 0x88); else |