diff options
author | Zhang Peng <peng.zhang_8@nxp.com> | 2020-09-09 13:34:40 +0800 |
---|---|---|
committer | Zhang Peng <peng.zhang_8@nxp.com> | 2020-09-09 14:02:44 +0800 |
commit | c1e09d541581af52cd42ad4e4ab7170d5c6a012d (patch) | |
tree | 92c52c95e627788cd2cb83fe864286fcd273c4ae /sound/soc/fsl/fsl_dsp_platform_compress.c | |
parent | 67a6a0ff58dc2494f43ed526f877c6b8788c7784 (diff) |
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 <peng.zhang_8@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_dsp_platform_compress.c')
-rw-r--r-- | sound/soc/fsl/fsl_dsp_platform_compress.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |