diff options
author | Chen Liangjun <b36089@freescale.com> | 2012-08-23 12:30:57 +0800 |
---|---|---|
committer | Chen Liangjun <b36089@freescale.com> | 2012-08-24 10:42:06 +0800 |
commit | aece51a192d8a1bb1eb7302519d5ab9699f18551 (patch) | |
tree | 46f50972d5233d69019c8e7135a3fc4afc9ac414 /sound | |
parent | 12af2814e89076095dd729cf324fc88088bd79e8 (diff) |
ENGR00221177 ESAI ASRC: add mutex protection between ESAI and ASRC P2P
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/imx/imx-esai.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/imx/imx-esai.c b/sound/soc/imx/imx-esai.c index bc56d8073dce..359cb2a4aea0 100644 --- a/sound/soc/imx/imx-esai.c +++ b/sound/soc/imx/imx-esai.c @@ -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); |