diff options
author | Viorel Suman <viorel.suman@nxp.com> | 2018-07-04 11:58:49 +0300 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:48:32 +0800 |
commit | 683763a08c7b0c03d7d4ab851d98e19a9174bb96 (patch) | |
tree | 67f9a31f8198243f751997919eb19465b0f8bf27 /sound/soc/fsl/fsl_asrc.c | |
parent | de02517719e08453202f44aa46cb7dd789aeca78 (diff) |
MLK-18737: move 'pair_streams' to 'struct fsl_asrc_pair'
For multi p2p instance an ASRC device cannot be closed successfully
when two threads plays streams simultaneously on same ASRC device.
'pair_streams' variable shall be moved to 'struct fsl_asrc_pair'
for multi p2p instance in order to handle pair release properly.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc.c')
-rw-r--r-- | sound/soc/fsl/fsl_asrc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 2b1decbe61cc..154937bd03a8 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -593,7 +593,7 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream, return ret; } - asrc_priv->pair_streams |= BIT(substream->stream); + pair->pair_streams |= BIT(substream->stream); pair->config = &config; if (width == 16) @@ -650,14 +650,12 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream, static int fsl_asrc_dai_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai); struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; - if (asrc_priv->pair_streams & BIT(substream->stream)) { - if (pair) - fsl_asrc_release_pair(pair); - asrc_priv->pair_streams &= ~BIT(substream->stream); + if (pair && (pair->pair_streams & BIT(substream->stream))) { + fsl_asrc_release_pair(pair); + pair->pair_streams &= ~BIT(substream->stream); } return 0; |