aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2015-01-20 02:43:16 -0500
committerMark Brown <broonie@kernel.org>2015-01-27 12:32:36 -0500
commita43bd7e125143b875caae6d4f9938855b440faaf (patch)
tree00e36a130bd496502069d9b703b2b3b54fde04bd /sound/soc/atmel
parent97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff)
ASoC: atmel_ssc_dai: fix start event for I2S mode
According to the I2S specification information as following: - WS = 0, channel 1 (left) - WS = 1, channel 2 (right) So, the start event should be TF/RF falling edge. Reported-by: Songjun Wu <songjun.wu@atmel.com> Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r--sound/soc/atmel/atmel_ssc_dai.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 99ff35e2a25d..e691aab60761 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
348 struct atmel_pcm_dma_params *dma_params; 348 struct atmel_pcm_dma_params *dma_params;
349 int dir, channels, bits; 349 int dir, channels, bits;
350 u32 tfmr, rfmr, tcmr, rcmr; 350 u32 tfmr, rfmr, tcmr, rcmr;
351 int start_event;
352 int ret; 351 int ret;
353 int fslen, fslen_ext; 352 int fslen, fslen_ext;
354 353
@@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
457 * The SSC transmit clock is obtained from the BCLK signal on 456 * The SSC transmit clock is obtained from the BCLK signal on
458 * on the TK line, and the SSC receive clock is 457 * on the TK line, and the SSC receive clock is
459 * generated from the transmit clock. 458 * generated from the transmit clock.
460 *
461 * For single channel data, one sample is transferred
462 * on the falling edge of the LRC clock.
463 * For two channel data, one sample is
464 * transferred on both edges of the LRC clock.
465 */ 459 */
466 start_event = ((channels == 1)
467 ? SSC_START_FALLING_RF
468 : SSC_START_EDGE_RF);
469
470 rcmr = SSC_BF(RCMR_PERIOD, 0) 460 rcmr = SSC_BF(RCMR_PERIOD, 0)
471 | SSC_BF(RCMR_STTDLY, START_DELAY) 461 | SSC_BF(RCMR_STTDLY, START_DELAY)
472 | SSC_BF(RCMR_START, start_event) 462 | SSC_BF(RCMR_START, SSC_START_FALLING_RF)
473 | SSC_BF(RCMR_CKI, SSC_CKI_RISING) 463 | SSC_BF(RCMR_CKI, SSC_CKI_RISING)
474 | SSC_BF(RCMR_CKO, SSC_CKO_NONE) 464 | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
475 | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? 465 | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
478 rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) 468 rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
479 | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) 469 | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
480 | SSC_BF(RFMR_FSLEN, 0) 470 | SSC_BF(RFMR_FSLEN, 0)
481 | SSC_BF(RFMR_DATNB, 0) 471 | SSC_BF(RFMR_DATNB, (channels - 1))
482 | SSC_BIT(RFMR_MSBF) 472 | SSC_BIT(RFMR_MSBF)
483 | SSC_BF(RFMR_LOOP, 0) 473 | SSC_BF(RFMR_LOOP, 0)
484 | SSC_BF(RFMR_DATLEN, (bits - 1)); 474 | SSC_BF(RFMR_DATLEN, (bits - 1));
485 475
486 tcmr = SSC_BF(TCMR_PERIOD, 0) 476 tcmr = SSC_BF(TCMR_PERIOD, 0)
487 | SSC_BF(TCMR_STTDLY, START_DELAY) 477 | SSC_BF(TCMR_STTDLY, START_DELAY)
488 | SSC_BF(TCMR_START, start_event) 478 | SSC_BF(TCMR_START, SSC_START_FALLING_RF)
489 | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) 479 | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
490 | SSC_BF(TCMR_CKO, SSC_CKO_NONE) 480 | SSC_BF(TCMR_CKO, SSC_CKO_NONE)
491 | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? 481 | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
495 | SSC_BF(TFMR_FSDEN, 0) 485 | SSC_BF(TFMR_FSDEN, 0)
496 | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) 486 | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
497 | SSC_BF(TFMR_FSLEN, 0) 487 | SSC_BF(TFMR_FSLEN, 0)
498 | SSC_BF(TFMR_DATNB, 0) 488 | SSC_BF(TFMR_DATNB, (channels - 1))
499 | SSC_BIT(TFMR_MSBF) 489 | SSC_BIT(TFMR_MSBF)
500 | SSC_BF(TFMR_DATDEF, 0) 490 | SSC_BF(TFMR_DATDEF, 0)
501 | SSC_BF(TFMR_DATLEN, (bits - 1)); 491 | SSC_BF(TFMR_DATLEN, (bits - 1));