提交 89e47f62 编写于 作者: N Nicolin Chen 提交者: Mark Brown

ASoC: fsl_esai: Fix incorrect condition within ratio range check for FP

The range here from 1 to 16 is confined to FP divider only while the
sck_div indicates if the calculation contains PSR and PM dividers. So
for the case using PSR and PM since the sck_div is true, the range of
ratio would simply become bigger than 16.

So this patch fixes the condition here and adds one line comments to
make the purpose here clear.
Signed-off-by: NNicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 c9eaa447
...@@ -307,7 +307,8 @@ static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq) ...@@ -307,7 +307,8 @@ static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
return -EINVAL; return -EINVAL;
} }
if (esai_priv->sck_div[tx] && (ratio > 16 || ratio == 0)) { /* The ratio should be contented by FP alone if bypassing PM and PSR */
if (!esai_priv->sck_div[tx] && (ratio > 16 || ratio == 0)) {
dev_err(dai->dev, "the ratio is out of range (1 ~ 16)\n"); dev_err(dai->dev, "the ratio is out of range (1 ~ 16)\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册