diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-07-10 06:43:54 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 06:10:37 -0400 |
commit | b2c119b0bba808608c48a8f7c9d727956d56561a (patch) | |
tree | c6ebd511964e0d7d6bf03e3463219d4a0c5e783d /sound/soc/fsl/fsl_ssi.c | |
parent | 624dcbdea24b599484895ed5b6a18e869e08d2a5 (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>
Diffstat (limited to 'sound/soc/fsl/fsl_ssi.c')
-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 2f2d837df07f..b6ab341a875c 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -510,6 +510,9 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
510 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0); | 510 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0); |
511 | else | 511 | else |
512 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0); | 512 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0); |
513 | |||
514 | if ((read_ssi(&ssi->scr) & (CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0) | ||
515 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0); | ||
513 | break; | 516 | break; |
514 | 517 | ||
515 | default: | 518 | default: |
@@ -534,15 +537,6 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, | |||
534 | ssi_private->first_stream = ssi_private->second_stream; | 537 | ssi_private->first_stream = ssi_private->second_stream; |
535 | 538 | ||
536 | ssi_private->second_stream = NULL; | 539 | ssi_private->second_stream = NULL; |
537 | |||
538 | /* | ||
539 | * If this is the last active substream, disable the SSI. | ||
540 | */ | ||
541 | if (!ssi_private->first_stream) { | ||
542 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | ||
543 | |||
544 | write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0); | ||
545 | } | ||
546 | } | 540 | } |
547 | 541 | ||
548 | static int fsl_ssi_dai_probe(struct snd_soc_dai *dai) | 542 | static int fsl_ssi_dai_probe(struct snd_soc_dai *dai) |