diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-07-10 06:43:54 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:00:51 -0400 |
commit | 1d66f062c76f1d81a82997c881134c55c8644ca4 (patch) | |
tree | 3e3c2657e9af98d1e2f29157d1fc17205e92d5b4 | |
parent | 2834b2638cebb008bb68104ea35690dbcc9b147e (diff) |
ASoC: fsl: Disable SSI in trigger() if RE/TE are both cleared
The code enabled SSIEN when triggered by SNDRV_PCM_TRIGGER_START,
so move the disable code to SNDRV_PCM_TRIGGER_STOP for symmetric.
This also allows us to use the SSI driver more flexible so that
it can support some use cases like "aplay S16_LE.wav S24_LE.wav"
which would call the driver in sequence like:
startup()->hw_params(S16_LE)->trigger(START)->tirgger(STOP)->
hw_params(S24_LE)->trigger(START)->tirgger(STOP)->shutdown()
If we disable SSIEN in shutdown(), the second hw_params() would
bypass the sample bits setting while using symmetric_rate.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index d1d1e976cb88..7a625602273a 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -508,6 +508,9 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
508 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0); | 508 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0); |
509 | else | 509 | else |
510 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0); | 510 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0); |
511 | |||
512 | if ((read_ssi(&ssi->scr) & (CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0) | ||
513 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0); | ||
511 | break; | 514 | break; |
512 | 515 | ||
513 | default: | 516 | default: |
@@ -532,15 +535,6 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, | |||
532 | ssi_private->first_stream = ssi_private->second_stream; | 535 | ssi_private->first_stream = ssi_private->second_stream; |
533 | 536 | ||
534 | ssi_private->second_stream = NULL; | 537 | ssi_private->second_stream = NULL; |
535 | |||
536 | /* | ||
537 | * If this is the last active substream, disable the SSI. | ||
538 | */ | ||
539 | if (!ssi_private->first_stream) { | ||
540 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | ||
541 | |||
542 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0); | ||
543 | } | ||
544 | } | 538 | } |
545 | 539 | ||
546 | static int fsl_ssi_dai_probe(struct snd_soc_dai *dai) | 540 | static int fsl_ssi_dai_probe(struct snd_soc_dai *dai) |