aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2019-08-09 19:50:30 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2019-08-27 11:10:01 +0200
commit2340c646e6a5da658e114be2f721ff90853588d4 (patch)
treedf9744d2344e71e8c5d1b75c3e1528bc474313fe /target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch
parent81d0da118694feb874f992093063a2852285d194 (diff)
downloadupstream-2340c646e6a5da658e114be2f721ff90853588d4.tar.gz
upstream-2340c646e6a5da658e114be2f721ff90853588d4.tar.bz2
upstream-2340c646e6a5da658e114be2f721ff90853588d4.zip
brcm2708: update to latest patches from RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch')
-rw-r--r--target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch b/target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch
new file mode 100644
index 0000000000..e539ab07fd
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.19/950-0397-ASoC-tlv320aic32x4-SND_SOC_DAPM_MICBIAS-is-deprecate.patch
@@ -0,0 +1,78 @@
+From 6401f3831443dc2eeb588f8d08e7513298dd2c52 Mon Sep 17 00:00:00 2001
+From: b-ak <anur.bhargav@gmail.com>
+Date: Wed, 9 Jan 2019 22:41:21 +0530
+Subject: [PATCH 397/773] ASoC: tlv320aic32x4: SND_SOC_DAPM_MICBIAS is
+ deprecated
+
+commit 04d979d7a7bac2f645cd827ea37e5ffa5b4e1f97 upstream.
+
+SND_SOC_DAPM_MICBIAS is deprecated, replace it with SND_SOC_DAPM_SUPPLY.
+
+MICBIAS voltage wasn't supplied to the microphone with the older
+SND_SOC_DAPM_MICBIAS widget, hence the microphone wouldn't work.
+
+This patch fixes the problem.
+
+Signed-off-by: b-ak <anur.bhargav@gmail.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+---
+ sound/soc/codecs/tlv320aic32x4.c | 30 +++++++++++++++++++++++++++++-
+ sound/soc/codecs/tlv320aic32x4.h | 1 +
+ 2 files changed, 30 insertions(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/tlv320aic32x4.c
++++ b/sound/soc/codecs/tlv320aic32x4.c
+@@ -79,6 +79,32 @@ struct aic32x4_priv {
+ struct device *dev;
+ };
+
++static int mic_bias_event(struct snd_soc_dapm_widget *w,
++ struct snd_kcontrol *kcontrol, int event)
++{
++ struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
++
++ switch (event) {
++ case SND_SOC_DAPM_POST_PMU:
++ /* Change Mic Bias Registor */
++ snd_soc_component_update_bits(component, AIC32X4_MICBIAS,
++ AIC32x4_MICBIAS_MASK,
++ AIC32X4_MICBIAS_LDOIN |
++ AIC32X4_MICBIAS_2075V);
++ printk(KERN_DEBUG "%s: Mic Bias will be turned ON\n", __func__);
++ break;
++ case SND_SOC_DAPM_PRE_PMD:
++ snd_soc_component_update_bits(component, AIC32X4_MICBIAS,
++ AIC32x4_MICBIAS_MASK, 0);
++ printk(KERN_DEBUG "%s: Mic Bias will be turned OFF\n",
++ __func__);
++ break;
++ }
++
++ return 0;
++}
++
++
+ static int aic32x4_get_mfp1_gpio(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+ {
+@@ -450,7 +476,9 @@ static const struct snd_soc_dapm_widget
+ SND_SOC_DAPM_MUX("IN3_R to Left Mixer Negative Resistor", SND_SOC_NOPM, 0, 0,
+ in3r_to_lmixer_controls),
+
+- SND_SOC_DAPM_MICBIAS("Mic Bias", AIC32X4_MICBIAS, 6, 0),
++ SND_SOC_DAPM_SUPPLY("Mic Bias", AIC32X4_MICBIAS, 6, 0, mic_bias_event,
++ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
++
+
+ SND_SOC_DAPM_OUTPUT("HPL"),
+ SND_SOC_DAPM_OUTPUT("HPR"),
+--- a/sound/soc/codecs/tlv320aic32x4.h
++++ b/sound/soc/codecs/tlv320aic32x4.h
+@@ -195,6 +195,7 @@ int aic32x4_remove(struct device *dev);
+ /* AIC32X4_MICBIAS */
+ #define AIC32X4_MICBIAS_LDOIN BIT(3)
+ #define AIC32X4_MICBIAS_2075V 0x60
++#define AIC32x4_MICBIAS_MASK GENMASK(6, 3)
+
+ /* AIC32X4_LMICPGANIN */
+ #define AIC32X4_LMICPGANIN_IN2R_10K 0x10