diff options
author | Bo Shen <voice.shen@atmel.com> | 2014-02-10 01:09:45 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-12 12:21:22 -0500 |
commit | 048d4ff81f1cf26b3f3627a9a69d35aff7898bb3 (patch) | |
tree | 694e6f6a08952f43c704693523984a3d8414d3eb /sound/soc/atmel | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
ASoC: atmel_ssc_dai: make option to choose clock
When SSC works in slave mode, according to the hardware design, the
clock can get from TK pin, also can get from RK pin. So, add one
parameter to choose where the clock from.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/atmel_ssc_dai.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 1ead3c977a51..de433cfd044c 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c | |||
@@ -341,6 +341,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
341 | { | 341 | { |
342 | int id = dai->id; | 342 | int id = dai->id; |
343 | struct atmel_ssc_info *ssc_p = &ssc_info[id]; | 343 | struct atmel_ssc_info *ssc_p = &ssc_info[id]; |
344 | struct ssc_device *ssc = ssc_p->ssc; | ||
344 | struct atmel_pcm_dma_params *dma_params; | 345 | struct atmel_pcm_dma_params *dma_params; |
345 | int dir, channels, bits; | 346 | int dir, channels, bits; |
346 | u32 tfmr, rfmr, tcmr, rcmr; | 347 | u32 tfmr, rfmr, tcmr, rcmr; |
@@ -466,7 +467,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
466 | | SSC_BF(RCMR_START, start_event) | 467 | | SSC_BF(RCMR_START, start_event) |
467 | | SSC_BF(RCMR_CKI, SSC_CKI_RISING) | 468 | | SSC_BF(RCMR_CKI, SSC_CKI_RISING) |
468 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) | 469 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
469 | | SSC_BF(RCMR_CKS, SSC_CKS_CLOCK); | 470 | | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? |
471 | SSC_CKS_PIN : SSC_CKS_CLOCK); | ||
470 | 472 | ||
471 | rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) | 473 | rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
472 | | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) | 474 | | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) |
@@ -481,7 +483,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
481 | | SSC_BF(TCMR_START, start_event) | 483 | | SSC_BF(TCMR_START, start_event) |
482 | | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) | 484 | | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) |
483 | | SSC_BF(TCMR_CKO, SSC_CKO_NONE) | 485 | | SSC_BF(TCMR_CKO, SSC_CKO_NONE) |
484 | | SSC_BF(TCMR_CKS, SSC_CKS_PIN); | 486 | | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? |
487 | SSC_CKS_CLOCK : SSC_CKS_PIN); | ||
485 | 488 | ||
486 | tfmr = SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) | 489 | tfmr = SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
487 | | SSC_BF(TFMR_FSDEN, 0) | 490 | | SSC_BF(TFMR_FSDEN, 0) |
@@ -550,7 +553,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
550 | | SSC_BF(RCMR_START, SSC_START_RISING_RF) | 553 | | SSC_BF(RCMR_START, SSC_START_RISING_RF) |
551 | | SSC_BF(RCMR_CKI, SSC_CKI_RISING) | 554 | | SSC_BF(RCMR_CKI, SSC_CKI_RISING) |
552 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) | 555 | | SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
553 | | SSC_BF(RCMR_CKS, SSC_CKS_PIN); | 556 | | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? |
557 | SSC_CKS_PIN : SSC_CKS_CLOCK); | ||
554 | 558 | ||
555 | rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) | 559 | rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
556 | | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) | 560 | | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) |
@@ -565,7 +569,8 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | |||
565 | | SSC_BF(TCMR_START, SSC_START_RISING_RF) | 569 | | SSC_BF(TCMR_START, SSC_START_RISING_RF) |
566 | | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) | 570 | | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) |
567 | | SSC_BF(TCMR_CKO, SSC_CKO_NONE) | 571 | | SSC_BF(TCMR_CKO, SSC_CKO_NONE) |
568 | | SSC_BF(TCMR_CKS, SSC_CKS_PIN); | 572 | | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? |
573 | SSC_CKS_CLOCK : SSC_CKS_PIN); | ||
569 | 574 | ||
570 | tfmr = SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) | 575 | tfmr = SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
571 | | SSC_BF(TFMR_FSDEN, 0) | 576 | | SSC_BF(TFMR_FSDEN, 0) |