lkml.org 
[lkml]   [2017]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] ASoC: codecs: msm8916-wcd-digital: fix dmic support
Date
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

This patch fixes dmic support which was broken in this driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
sound/soc/codecs/msm8916-wcd-digital.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
index 126a0ee8aded..3265bd404fd7 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -168,6 +168,9 @@

#define LPASS_CDC_TX2_VOL_CTL_CFG (0x2A8)
#define LPASS_CDC_TX1_MUX_CTL (0x28C)
+#define TX_MUX_CTL_ADC_DMIC_SEL_MASK BIT(0)
+#define TX_MUX_CTL_ADC_DMIC_SEL_DMIC BIT(0)
+#define TX_MUX_CTL_ADC_DMIC_SEL_ADC 0
#define TX_MUX_CTL_CUT_OFF_FREQ_MASK GENMASK(5, 4)
#define TX_MUX_CTL_CUT_OFF_FREQ_SHIFT 4
#define TX_MUX_CTL_CF_NEG_3DB_4HZ (0x0 << 4)
@@ -439,17 +442,37 @@ static int msm8916_wcd_digital_enable_dmic(struct snd_soc_dapm_widget *w,
DMIC_B1_CTL_DMIC0_CLK_SEL_DIV3);
switch (dmic) {
case 1:
+ snd_soc_update_bits(codec, LPASS_CDC_TX1_MUX_CTL,
+ TX_MUX_CTL_ADC_DMIC_SEL_MASK,
+ TX_MUX_CTL_ADC_DMIC_SEL_DMIC);
snd_soc_update_bits(codec, LPASS_CDC_TX1_DMIC_CTL,
TXN_DMIC_CTL_CLK_SEL_MASK,
TXN_DMIC_CTL_CLK_SEL_DIV3);
break;
case 2:
+ snd_soc_update_bits(codec, LPASS_CDC_TX2_MUX_CTL,
+ TX_MUX_CTL_ADC_DMIC_SEL_MASK,
+ TX_MUX_CTL_ADC_DMIC_SEL_DMIC);
snd_soc_update_bits(codec, LPASS_CDC_TX2_DMIC_CTL,
TXN_DMIC_CTL_CLK_SEL_MASK,
TXN_DMIC_CTL_CLK_SEL_DIV3);
break;
}
break;
+ case SND_SOC_DAPM_POST_PMD:
+ switch (dmic) {
+ case 1:
+ snd_soc_update_bits(codec, LPASS_CDC_TX1_MUX_CTL,
+ TX_MUX_CTL_ADC_DMIC_SEL_MASK,
+ 0);
+ break;
+ case 2:
+ snd_soc_update_bits(codec, LPASS_CDC_TX2_MUX_CTL,
+ TX_MUX_CTL_ADC_DMIC_SEL_MASK,
+ 0);
+ break;
+ }
+ break;
}

return 0;
@@ -536,6 +559,8 @@ static const struct snd_soc_dapm_widget msm8916_wcd_digital_dapm_widgets[] = {
/* Connectivity Clock */
SND_SOC_DAPM_SUPPLY_S("CDC_CONN", -2, LPASS_CDC_CLK_OTHR_CTL, 2, 0,
NULL, 0),
+ SND_SOC_DAPM_MIC("Digital Mic1", NULL),
+ SND_SOC_DAPM_MIC("Digital Mic2", NULL),

};

--
2.11.0
\
 
 \ /
  Last update: 2017-07-17 15:55    [W:0.050 / U:2.312 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site