/* Shutdown the SSI if there are no other substreams open.  */
static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
/* Shutdown the SSI if there are no other substreams open.  */
static void fsl_ssi_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		ssi_private->playback--;
	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
		ssi_private->capture--;
	if (ssi_private->first_stream == substream)
		ssi_private->first_stream = ssi_private->second_stream;
	ssi_private->second_stream = NULL;
	if (!ssi_private->playback && !ssi_private->capture) {
		struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
		clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
		free_irq(ssi_private->irq, ssi_private);
	}
}