ESAI playback and ASRC P2P playback use difference codec_dai while using
the same codec. Thus they can't work together.
In this patch, add mutual protection between ESAI playback and ASRC P2P
playback.
Signed-off-by: Chen Liangjun <b36089@freescale.com>
{
struct imx_esai *esai = snd_soc_dai_get_drvdata(cpu_dai);
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+ (local_esai->imx_esai_txrx_state & IMX_DAI_ESAI_TX)) {
+ pr_err("error: too much esai playback!\n");
+ return -EINVAL;
+ }
+
if (!(local_esai->imx_esai_txrx_state & IMX_DAI_ESAI_TXRX)) {
clk_enable(esai->clk);