Skip to content

Commit

Permalink
Intel: ASoC: Add condition check before set param to waves
Browse files Browse the repository at this point in the history
Check waves state before set parameter through ipc to prevent unexpected
operation. Also remove redundant check.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Lu, Han authored and Mark Brown committed Mar 19, 2015
1 parent 91b0d9a commit 5d5b275
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions sound/soc/intel/sst-haswell-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,11 @@ int sst_hsw_launch_param_buf(struct sst_hsw *hsw)
{
int ret, idx;

if (!sst_hsw_is_module_active(hsw, SST_HSW_MODULE_WAVES)) {
dev_dbg(hsw->dev, "module waves is not active\n");
return 0;
}

/* put all param lines to DSP through ipc */
for (idx = 0; idx < hsw->param_idx_w; idx++) {
ret = sst_hsw_module_set_param(hsw,
Expand Down
6 changes: 1 addition & 5 deletions sound/soc/intel/sst-haswell-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,9 @@ static int hsw_waves_param_put(struct snd_kcontrol *kcontrol,
if (ret < 0)
return ret;

if (sst_hsw_is_module_loaded(hsw, id)) {
if (!sst_hsw_is_module_active(hsw, id))
return 0;

if (sst_hsw_is_module_active(hsw, id))
ret = sst_hsw_module_set_param(hsw, id, 0, param_id,
param_size, ucontrol->value.bytes.data);
}
return ret;
}

Expand Down

0 comments on commit 5d5b275

Please sign in to comment.