aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolin Chen <nicoleotsuka@gmail.com>2015-05-24 04:12:41 -0400
committerMark Brown <broonie@kernel.org>2015-05-25 07:58:01 -0400
commitf490f326178a6fec87a9bc3d35525bc9cb96ef0e (patch)
tree609888cfab4b3cb2c81e937b2615481c1d97306d
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
ASoC: fsl_spdif: Don't try to round-up for clock divisor calculation
As commit 6c8ca30eec7b ("ASoC: fsl_ssi: Don't try to round-up for PM divisor calculation") mentioned that there's no more need to use a round up work around to get a better divisor since the clk-divider driver has been refined a lot. So this patch applies the same modification to fsl_spdif driver. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl_spdif.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 91eb3aef7f02..8e932219cb3a 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -417,11 +417,9 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream,
417 if (clk != STC_TXCLK_SPDIF_ROOT) 417 if (clk != STC_TXCLK_SPDIF_ROOT)
418 goto clk_set_bypass; 418 goto clk_set_bypass;
419 419
420 /* 420 /* The S/PDIF block needs a clock of 64 * fs * txclk_df */
421 * The S/PDIF block needs a clock of 64 * fs * txclk_df. 421 ret = clk_set_rate(spdif_priv->txclk[rate],
422 * So request 64 * fs * (txclk_df + 1) to get rounded. 422 64 * sample_rate * txclk_df);
423 */
424 ret = clk_set_rate(spdif_priv->txclk[rate], 64 * sample_rate * (txclk_df + 1));
425 if (ret) { 423 if (ret) {
426 dev_err(&pdev->dev, "failed to set tx clock rate\n"); 424 dev_err(&pdev->dev, "failed to set tx clock rate\n");
427 return ret; 425 return ret;
@@ -1060,7 +1058,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv,
1060 1058
1061 for (sysclk_df = sysclk_dfmin; sysclk_df <= sysclk_dfmax; sysclk_df++) { 1059 for (sysclk_df = sysclk_dfmin; sysclk_df <= sysclk_dfmax; sysclk_df++) {
1062 for (txclk_df = 1; txclk_df <= 128; txclk_df++) { 1060 for (txclk_df = 1; txclk_df <= 128; txclk_df++) {
1063 rate_ideal = rate[index] * (txclk_df + 1) * 64; 1061 rate_ideal = rate[index] * txclk_df * 64;
1064 if (round) 1062 if (round)
1065 rate_actual = clk_round_rate(clk, rate_ideal); 1063 rate_actual = clk_round_rate(clk, rate_ideal);
1066 else 1064 else