Skip to content

Commit

Permalink
ASoC: fsl_esai: Fix incorrect condition within ratio range check for FP
Browse files Browse the repository at this point in the history
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: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Nicolin Chen authored and Mark Brown committed May 12, 2014
1 parent c9eaa44 commit 89e47f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/fsl/fsl_esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
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");
return -EINVAL;
}
Expand Down

0 comments on commit 89e47f6

Please sign in to comment.