From: Srinivas Kandagatla <[email protected]>

MCLK for internal audio codec is expected to be at 9.6MHz by default.
This patch adds support to 9.6MHz to make the default case possible.

Signed-off-by: Srinivas Kandagatla <[email protected]>
---
 sound/soc/qcom/apq8016_sbc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index d084d7468299..1064c1b85c63 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -34,10 +34,12 @@ struct apq8016_sbc_data {
 #define MIC_CTRL_QUA_WS_SLAVE_SEL_10   BIT(17)
 #define MIC_CTRL_TLMM_SCLK_EN          BIT(1)
 #define        SPKR_CTL_PRI_WS_SLAVE_SEL_11    (BIT(17) | BIT(16))
+#define DEFAULT_MCLK_RATE              9600000
 
 static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *codec_dai = rtd->codec_dai;
        struct snd_soc_card *card = rtd->card;
        struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card);
        int rval = 0;
@@ -68,6 +70,10 @@ static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime 
*rtd)
 
        }
 
+       /* Set default mclk for internal codec */
+       snd_soc_dai_set_sysclk(codec_dai, 0, DEFAULT_MCLK_RATE,
+                              SND_SOC_CLOCK_IN);
+
        return rval;
 }
 
-- 
2.11.0

Reply via email to