aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-11-09 06:02:29 -0500
committerMark Brown <broonie@kernel.org>2015-11-17 13:51:36 -0500
commit9cc58712358cbfe51248ef369fc50671149b60fc (patch)
treea6406d4c67b87037d062678474d705c29e6105af
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
ASoC: fsl-sai: don't set bclk for Tx/Rx Synchronous with another SAI mode
In fsl_sai_set_bclk function, we should not set bclk for Tx/Rx Synchronous with another SAI mode. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl_sai.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index a4435f5e3be9..7e421a97c090 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -354,13 +354,25 @@ static int fsl_sai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
354 return -EINVAL; 354 return -EINVAL;
355 } 355 }
356 356
357 if ((tx && sai->synchronous[TX]) || (!tx && !sai->synchronous[RX])) { 357 /*
358 * 1) For Asynchronous mode, we must set RCR2 register for capture, and
359 * set TCR2 register for playback.
360 * 2) For Tx sync with Rx clock, we must set RCR2 register for playback
361 * and capture.
362 * 3) For Rx sync with Tx clock, we must set TCR2 register for playback
363 * and capture.
364 * 4) For Tx and Rx are both Synchronous with another SAI, we just
365 * ignore it.
366 */
367 if ((sai->synchronous[TX] && !sai->synchronous[RX]) ||
368 (!tx && !sai->synchronous[RX])) {
358 regmap_update_bits(sai->regmap, FSL_SAI_RCR2, 369 regmap_update_bits(sai->regmap, FSL_SAI_RCR2,
359 FSL_SAI_CR2_MSEL_MASK, 370 FSL_SAI_CR2_MSEL_MASK,
360 FSL_SAI_CR2_MSEL(sai->mclk_id[tx])); 371 FSL_SAI_CR2_MSEL(sai->mclk_id[tx]));
361 regmap_update_bits(sai->regmap, FSL_SAI_RCR2, 372 regmap_update_bits(sai->regmap, FSL_SAI_RCR2,
362 FSL_SAI_CR2_DIV_MASK, savediv - 1); 373 FSL_SAI_CR2_DIV_MASK, savediv - 1);
363 } else { 374 } else if ((sai->synchronous[RX] && !sai->synchronous[TX]) ||
375 (tx && !sai->synchronous[TX])) {
364 regmap_update_bits(sai->regmap, FSL_SAI_TCR2, 376 regmap_update_bits(sai->regmap, FSL_SAI_TCR2,
365 FSL_SAI_CR2_MSEL_MASK, 377 FSL_SAI_CR2_MSEL_MASK,
366 FSL_SAI_CR2_MSEL(sai->mclk_id[tx])); 378 FSL_SAI_CR2_MSEL(sai->mclk_id[tx]));