summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorNicolin Chen <Guangyu.Chen@freescale.com>2014-05-06 10:55:59 +0200
committerMark Brown <broonie@linaro.org>2014-05-13 00:13:13 +0200
commit89e47f62cf3eea7ad5e3d7d72ea846be37d6e352 (patch)
treec10e8835050654ae7efc97a56772e431f66527f2 /sound
parentLinux 3.15-rc1 (diff)
downloadlinux-89e47f62cf3eea7ad5e3d7d72ea846be37d6e352.tar.xz
linux-89e47f62cf3eea7ad5e3d7d72ea846be37d6e352.zip
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: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_esai.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index c8e5db1414d7..35c0b9295a80 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -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;
}