aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorNicolin Chen <nicoleotsuka@gmail.com>2015-02-11 00:31:43 -0500
committerMark Brown <broonie@kernel.org>2015-02-11 00:46:07 -0500
commit541b03ad6cfe0e415273f096fd8c47d2879c6c15 (patch)
tree6ae8ed723cc29ece6e2b75dda72cc8bd3592c32c /sound
parentbfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff)
ASoC: fsl_ssi: Fix the incorrect limitation of the bit clock rate
According to i.MX Reference Manual, the bit-clock frequency generated by SSI must be never greater than 1/5 of the peripheral clock frequency. This peripheral clock, however, is not baudclk but the IPG clock (i.e. ssi_private->clk in the fsl_ssi driver). So this patch just simply fixes the incorrect limitation applied to the bit clock (baudclk) rate. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_ssi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 059496ed9ad7..d7365c5d7ec0 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -603,10 +603,6 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
603 factor = (div2 + 1) * (7 * psr + 1) * 2; 603 factor = (div2 + 1) * (7 * psr + 1) * 2;
604 604
605 for (i = 0; i < 255; i++) { 605 for (i = 0; i < 255; i++) {
606 /* The bclk rate must be smaller than 1/5 sysclk rate */
607 if (factor * (i + 1) < 5)
608 continue;
609
610 tmprate = freq * factor * (i + 2); 606 tmprate = freq * factor * (i + 2);
611 607
612 if (baudclk_is_used) 608 if (baudclk_is_used)
@@ -614,6 +610,13 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
614 else 610 else
615 clkrate = clk_round_rate(ssi_private->baudclk, tmprate); 611 clkrate = clk_round_rate(ssi_private->baudclk, tmprate);
616 612
613 /*
614 * Hardware limitation: The bclk rate must be
615 * never greater than 1/5 IPG clock rate
616 */
617 if (clkrate * 5 > clk_get_rate(ssi_private->clk))
618 continue;
619
617 clkrate /= factor; 620 clkrate /= factor;
618 afreq = clkrate / (i + 1); 621 afreq = clkrate / (i + 1);
619 622