1 From 6401f3831443dc2eeb588f8d08e7513298dd2c52 Mon Sep 17 00:00:00 2001
2 From: b-ak <anur.bhargav@gmail.com>
3 Date: Wed, 9 Jan 2019 22:41:21 +0530
4 Subject: [PATCH 397/773] ASoC: tlv320aic32x4: SND_SOC_DAPM_MICBIAS is
7 commit 04d979d7a7bac2f645cd827ea37e5ffa5b4e1f97 upstream.
9 SND_SOC_DAPM_MICBIAS is deprecated, replace it with SND_SOC_DAPM_SUPPLY.
11 MICBIAS voltage wasn't supplied to the microphone with the older
12 SND_SOC_DAPM_MICBIAS widget, hence the microphone wouldn't work.
14 This patch fixes the problem.
16 Signed-off-by: b-ak <anur.bhargav@gmail.com>
17 Signed-off-by: Mark Brown <broonie@kernel.org>
19 sound/soc/codecs/tlv320aic32x4.c | 30 +++++++++++++++++++++++++++++-
20 sound/soc/codecs/tlv320aic32x4.h | 1 +
21 2 files changed, 30 insertions(+), 1 deletion(-)
23 --- a/sound/soc/codecs/tlv320aic32x4.c
24 +++ b/sound/soc/codecs/tlv320aic32x4.c
25 @@ -79,6 +79,32 @@ struct aic32x4_priv {
29 +static int mic_bias_event(struct snd_soc_dapm_widget *w,
30 + struct snd_kcontrol *kcontrol, int event)
32 + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
35 + case SND_SOC_DAPM_POST_PMU:
36 + /* Change Mic Bias Registor */
37 + snd_soc_component_update_bits(component, AIC32X4_MICBIAS,
38 + AIC32x4_MICBIAS_MASK,
39 + AIC32X4_MICBIAS_LDOIN |
40 + AIC32X4_MICBIAS_2075V);
41 + printk(KERN_DEBUG "%s: Mic Bias will be turned ON\n", __func__);
43 + case SND_SOC_DAPM_PRE_PMD:
44 + snd_soc_component_update_bits(component, AIC32X4_MICBIAS,
45 + AIC32x4_MICBIAS_MASK, 0);
46 + printk(KERN_DEBUG "%s: Mic Bias will be turned OFF\n",
55 static int aic32x4_get_mfp1_gpio(struct snd_kcontrol *kcontrol,
56 struct snd_ctl_elem_value *ucontrol)
58 @@ -450,7 +476,9 @@ static const struct snd_soc_dapm_widget
59 SND_SOC_DAPM_MUX("IN3_R to Left Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
60 in3r_to_lmixer_controls),
62 - SND_SOC_DAPM_MICBIAS("Mic Bias", AIC32X4_MICBIAS, 6, 0),
63 + SND_SOC_DAPM_SUPPLY("Mic Bias", AIC32X4_MICBIAS, 6, 0, mic_bias_event,
64 + SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
67 SND_SOC_DAPM_OUTPUT("HPL"),
68 SND_SOC_DAPM_OUTPUT("HPR"),
69 --- a/sound/soc/codecs/tlv320aic32x4.h
70 +++ b/sound/soc/codecs/tlv320aic32x4.h
71 @@ -195,6 +195,7 @@ int aic32x4_remove(struct device *dev);
73 #define AIC32X4_MICBIAS_LDOIN BIT(3)
74 #define AIC32X4_MICBIAS_2075V 0x60
75 +#define AIC32x4_MICBIAS_MASK GENMASK(6, 3)
77 /* AIC32X4_LMICPGANIN */
78 #define AIC32X4_LMICPGANIN_IN2R_10K 0x10