]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00221177 ESAI ASRC: add mutex protection between ESAI and ASRC P2P
authorChen Liangjun <b36089@freescale.com>
Thu, 23 Aug 2012 04:30:57 +0000 (12:30 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:18 +0000 (08:35 +0200)
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>
sound/soc/imx/imx-esai.c

index bc56d8073dceb957ed33672ba2fb13adef2ceeaa..359cb2a4aea0120e47e5b317142c853342c5f937 100644 (file)
@@ -278,6 +278,12 @@ static int imx_esai_startup(struct snd_pcm_substream *substream,
 {
        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);