Commit b2c119b0 authored by Nicolin Chen's avatar Nicolin Chen Committed by Mark Brown

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: default avatarNicolin Chen <b42378@freescale.com>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 624dcbde
...@@ -510,6 +510,9 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -510,6 +510,9 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0); write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0);
else else
write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0); write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0);
if ((read_ssi(&ssi->scr) & (CCSR_SSI_SCR_TE | CCSR_SSI_SCR_RE)) == 0)
write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
break; break;
default: default:
...@@ -534,15 +537,6 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, ...@@ -534,15 +537,6 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
ssi_private->first_stream = ssi_private->second_stream; ssi_private->first_stream = ssi_private->second_stream;
ssi_private->second_stream = NULL; ssi_private->second_stream = NULL;
/*
* If this is the last active substream, disable the SSI.
*/
if (!ssi_private->first_stream) {
struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
}
} }
static int fsl_ssi_dai_probe(struct snd_soc_dai *dai) static int fsl_ssi_dai_probe(struct snd_soc_dai *dai)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment