aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu, Han <han.lu@intel.com>2015-03-18 20:38:00 -0400
committerMark Brown <broonie@kernel.org>2015-03-18 20:49:11 -0400
commit5d5b275d727753372f0a390b4121738d073f3e94 (patch)
treee0e439159f52d70420d2e0d528cc4fdcbc9ad225
parent91b0d9aa933a2335f6f11983b19eaf9ebe3c2033 (diff)
Intel: ASoC: Add condition check before set param to waves
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>
-rw-r--r--sound/soc/intel/sst-haswell-ipc.c5
-rw-r--r--sound/soc/intel/sst-haswell-pcm.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index 43fb5f339168..20b629a011de 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -2055,6 +2055,11 @@ int sst_hsw_launch_param_buf(struct sst_hsw *hsw)
2055{ 2055{
2056 int ret, idx; 2056 int ret, idx;
2057 2057
2058 if (!sst_hsw_is_module_active(hsw, SST_HSW_MODULE_WAVES)) {
2059 dev_dbg(hsw->dev, "module waves is not active\n");
2060 return 0;
2061 }
2062
2058 /* put all param lines to DSP through ipc */ 2063 /* put all param lines to DSP through ipc */
2059 for (idx = 0; idx < hsw->param_idx_w; idx++) { 2064 for (idx = 0; idx < hsw->param_idx_w; idx++) {
2060 ret = sst_hsw_module_set_param(hsw, 2065 ret = sst_hsw_module_set_param(hsw,
diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index b40ec746bc19..6c6229ae4a02 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -399,13 +399,9 @@ static int hsw_waves_param_put(struct snd_kcontrol *kcontrol,
399 if (ret < 0) 399 if (ret < 0)
400 return ret; 400 return ret;
401 401
402 if (sst_hsw_is_module_loaded(hsw, id)) { 402 if (sst_hsw_is_module_active(hsw, id))
403 if (!sst_hsw_is_module_active(hsw, id))
404 return 0;
405
406 ret = sst_hsw_module_set_param(hsw, id, 0, param_id, 403 ret = sst_hsw_module_set_param(hsw, id, 0, param_id,
407 param_size, ucontrol->value.bytes.data); 404 param_size, ucontrol->value.bytes.data);
408 }
409 return ret; 405 return ret;
410} 406}
411 407