diff options
author | Viorel Suman <viorel.suman@nxp.com> | 2018-06-27 10:31:02 +0300 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:50:37 +0800 |
commit | e5c4922c52e9f2254d97da0d16ac9141b185633d (patch) | |
tree | 6d00385fde7263889ce3f04a35bfc301407cdeaf | |
parent | a73abcd3edf8f91bc778431a2bf218e9938d763f (diff) |
MLK-18682-1: ASoC: fsl: sai: use set_bclk_ratio to calculate BCLK freq (part 2)
ALSA API has a standard way to configure DAI BCLK by calling
"snd_soc_dai_set_bclk_ratio" function. So use it to set BCLK ratio
and calculate SAI BCLK frequency.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
[ Aisheng: split DAI sai changes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
-rw-r--r-- | sound/soc/fsl/imx-pdm.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/fsl/imx-pdm.c b/sound/soc/fsl/imx-pdm.c index e8cea5255209..d69e27ec50c8 100644 --- a/sound/soc/fsl/imx-pdm.c +++ b/sound/soc/fsl/imx-pdm.c @@ -67,7 +67,6 @@ static int imx_pdm_mic_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct snd_soc_card *card = rtd->card; struct imx_pdm_data *data = snd_soc_card_get_drvdata(card); - unsigned int bitclk = params_rate(params) * data->decimation; int ret; /* set cpu dai format configuration */ @@ -80,8 +79,7 @@ static int imx_pdm_mic_hw_params(struct snd_pcm_substream *substream, /* set tdm slots only one for now */ snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0, 1, 32); /* Set clock out */ - ret = snd_soc_dai_set_sysclk(cpu_dai, FSL_SAI_CLK_BIT, - bitclk, SND_SOC_CLOCK_OUT); + ret = snd_soc_dai_set_bclk_ratio(cpu_dai, data->decimation); if (ret) { dev_err(card->dev, "fail to set cpu sysclk: %d\n", ret); return ret; |