From c1e09d541581af52cd42ad4e4ab7170d5c6a012d Mon Sep 17 00:00:00 2001 From: Zhang Peng Date: Wed, 9 Sep 2020 13:34:40 +0800 Subject: LF-809 ASoc: fsl_dsp: Prevent compress dsp playing secend instance Compress dsp now only support one instance in the meantime, prevent to play the secend one. Fix issue The DSP stops to work if try to start the second cplay to DSP. Signed-off-by: Zhang Peng --- sound/soc/fsl/fsl_dsp_platform_compress.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound/soc/fsl/fsl_dsp_platform_compress.c') diff --git a/sound/soc/fsl/fsl_dsp_platform_compress.c b/sound/soc/fsl/fsl_dsp_platform_compress.c index 04a33774a5f2..9ba8f2556bfd 100644 --- a/sound/soc/fsl/fsl_dsp_platform_compress.c +++ b/sound/soc/fsl/fsl_dsp_platform_compress.c @@ -57,6 +57,8 @@ static int dsp_platform_compr_open(struct snd_compr_stream *cstream) struct fsl_dsp *dsp_priv = snd_soc_component_get_drvdata(component); struct dsp_data *drv = &dsp_priv->dsp_data; + if (drv->client) + return -EBUSY; drv->client = xf_client_alloc(dsp_priv); if (IS_ERR(drv->client)) return PTR_ERR(drv->client); @@ -121,6 +123,7 @@ static int dsp_platform_compr_free(struct snd_compr_stream *cstream) cancel_work_sync(&drv->client->work); fsl_dsp_close_func(drv->client); + drv->client = NULL; return 0; } -- cgit v1.2.3