aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
diff options
context:
space:
mode:
authorSimon Trimmer <simont@opensource.cirrus.com>2021-09-13 17:00:52 +0100
committerMark Brown <broonie@kernel.org>2021-09-27 13:00:37 +0100
commitedb1d6d7f03913b2b6ca299b1f6fd8dc96d511f5 (patch)
tree1f7a2d2ffa130d2b3e97f0e08cb2c740e413df18 /sound/soc/codecs/wm_adsp.c
parentASoC: wm_adsp: Separate generic cs_dsp_coeff_ctl handling (diff)
downloadlinux-dev-edb1d6d7f03913b2b6ca299b1f6fd8dc96d511f5.tar.xz
linux-dev-edb1d6d7f03913b2b6ca299b1f6fd8dc96d511f5.zip
ASoC: wm_adsp: Move check of dsp->running to better place
In preparation for moving the generic DSP support out of ASoC, move the check of dsp->running to a more appropriate place that will move to the generic code. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210913160057.103842-12-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r--sound/soc/codecs/wm_adsp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index bd335e4240e5..1c8bf818dab9 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -976,6 +976,9 @@ static int cs_dsp_coeff_write_acked_control(struct cs_dsp_coeff_ctl *ctl,
unsigned int reg;
int i, ret;
+ if (!dsp->running)
+ return -EPERM;
+
ret = cs_dsp_coeff_base_reg(ctl, &reg);
if (ret)
return ret;
@@ -1129,7 +1132,7 @@ static int wm_coeff_put_acked(struct snd_kcontrol *kctl,
mutex_lock(&cs_ctl->dsp->pwr_lock);
- if (cs_ctl->enabled && cs_ctl->dsp->running)
+ if (cs_ctl->enabled)
ret = cs_dsp_coeff_write_acked_control(cs_ctl, val);
else
ret = -EPERM;