/* Should only be called when port is inactive (i.e. SSIEN = 0), although can be called multiple times by upper layers.  */
int imx_ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
/* Should only be called when port is inactive (i.e. SSIEN = 0), although can be called multiple times by upper layers.  */
int imx_ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
	int ret;
	if (cpu_dai->id == IMX_DAI_SSI0 || cpu_dai->id == IMX_DAI_SSI2) {
		if (SSI1_SCR & SSI_SCR_SSIEN) {
			printk(KERN_WARNING "Warning ssi already enabled\n");
			return 0;
		}
	} else {
		if (SSI2_SCR & SSI_SCR_SSIEN) {
			printk(KERN_WARNING "Warning ssi already enabled\n");
			return 0;
		}
	}
	ret = imx_ssi_hw_tx_params(substream, params);
	if (ret < 0)
		return ret;
	return imx_ssi_hw_rx_params(substream, params);
}