MLK-20034-1: ASoC: imx-ak4458: constrain the mclk rate for DSD
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 23 Oct 2018 07:58:24 +0000 (15:58 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
When enable DSD for ak4458 with imx8mm platform, in DSD256 mode
the mclk calculated from ak4458_get_mclk_rate is 256fs, but
the codec require the mclk should be 512fs. so just hard code
the clock to be 512fs in DSD mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
sound/soc/fsl/imx-ak4458.c

index 40aa9e8..13d9807 100644 (file)
@@ -201,6 +201,8 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream,
 
        /* set MCLK freq */
        mclk_freq = ak4458_get_mclk_rate(substream, params);
+       if (is_dsd)
+               mclk_freq = 22579200;
        ret = snd_soc_dai_set_sysclk(cpu_dai, FSL_SAI_CLK_MAST1, mclk_freq,
                                     SND_SOC_CLOCK_OUT);
        if (ret < 0)