diff options
author | Mark Brown <broonie@kernel.org> | 2015-02-05 14:33:44 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-05 14:33:44 -0500 |
commit | 8c617791acaf5bd59999e47e0cce94b3759f20b5 (patch) | |
tree | bda8904f094bd569372e8207bb5d91a59118f8ea /sound | |
parent | e36f014edff70fc02b3d3d79cead1d58f289332e (diff) | |
parent | 20cf2603b122bf71fb54def1de6a2ad73d5ddb0b (diff) |
Merge remote-tracking branch 'asoc/fix/atmel' into asoc-linus
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/atmel/atmel_ssc_dai.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 99ff35e2a25d..35e44e463cfe 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)); |
@@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
512 | rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) | 502 | rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) |
513 | | SSC_BF(RCMR_STTDLY, 1) | 503 | | SSC_BF(RCMR_STTDLY, 1) |
514 | | SSC_BF(RCMR_START, SSC_START_RISING_RF) | 504 | | SSC_BF(RCMR_START, SSC_START_RISING_RF) |
515 | | SSC_BF(RCMR_CKI, SSC_CKI_RISING) | 505 | | SSC_BF(RCMR_CKI, SSC_CKI_FALLING) |
516 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) | 506 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
517 | | SSC_BF(RCMR_CKS, SSC_CKS_DIV); | 507 | | SSC_BF(RCMR_CKS, SSC_CKS_DIV); |
518 | 508 | ||
@@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
527 | tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) | 517 | tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) |
528 | | SSC_BF(TCMR_STTDLY, 1) | 518 | | SSC_BF(TCMR_STTDLY, 1) |
529 | | SSC_BF(TCMR_START, SSC_START_RISING_RF) | 519 | | SSC_BF(TCMR_START, SSC_START_RISING_RF) |
530 | | SSC_BF(TCMR_CKI, SSC_CKI_RISING) | 520 | | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) |
531 | | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS) | 521 | | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS) |
532 | | SSC_BF(TCMR_CKS, SSC_CKS_DIV); | 522 | | SSC_BF(TCMR_CKS, SSC_CKS_DIV); |
533 | 523 | ||
@@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
556 | rcmr = SSC_BF(RCMR_PERIOD, 0) | 546 | rcmr = SSC_BF(RCMR_PERIOD, 0) |
557 | | SSC_BF(RCMR_STTDLY, START_DELAY) | 547 | | SSC_BF(RCMR_STTDLY, START_DELAY) |
558 | | SSC_BF(RCMR_START, SSC_START_RISING_RF) | 548 | | SSC_BF(RCMR_START, SSC_START_RISING_RF) |
559 | | SSC_BF(RCMR_CKI, SSC_CKI_RISING) | 549 | | SSC_BF(RCMR_CKI, SSC_CKI_FALLING) |
560 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) | 550 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
561 | | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? | 551 | | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? |
562 | SSC_CKS_PIN : SSC_CKS_CLOCK); | 552 | SSC_CKS_PIN : SSC_CKS_CLOCK); |