aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-07-24 17:07:19 -0400
committerMark Brown <broonie@kernel.org>2016-07-24 17:07:19 -0400
commitd52dad0bf4aa0978473e7b8b79271039a5ce019f (patch)
tree7759c5f56e6ad06f0a2670f9b819236ffc65cca2
parent523d939ef98fd712632d93a5a2b588e477a7565e (diff)
parenta6d4faeb2960b47dca46b6969c4a5d8165b650c1 (diff)
Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus
-rw-r--r--sound/soc/intel/skylake/skl-topology.c13
-rw-r--r--sound/soc/intel/skylake/skl-topology.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 3e036b0349b9..c15b7f8962b3 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -448,7 +448,7 @@ static int skl_tplg_set_module_params(struct snd_soc_dapm_widget *w,
448 448
449 if (bc->set_params == SKL_PARAM_SET) { 449 if (bc->set_params == SKL_PARAM_SET) {
450 ret = skl_set_module_params(ctx, 450 ret = skl_set_module_params(ctx,
451 (u32 *)bc->params, bc->max, 451 (u32 *)bc->params, bc->size,
452 bc->param_id, mconfig); 452 bc->param_id, mconfig);
453 if (ret < 0) 453 if (ret < 0)
454 return ret; 454 return ret;
@@ -483,7 +483,7 @@ static int skl_tplg_set_module_init_data(struct snd_soc_dapm_widget *w)
483 continue; 483 continue;
484 484
485 mconfig->formats_config.caps = (u32 *)&bc->params; 485 mconfig->formats_config.caps = (u32 *)&bc->params;
486 mconfig->formats_config.caps_size = bc->max; 486 mconfig->formats_config.caps_size = bc->size;
487 487
488 break; 488 break;
489 } 489 }
@@ -1102,7 +1102,7 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
1102 1102
1103 if (w->power) 1103 if (w->power)
1104 skl_get_module_params(skl->skl_sst, (u32 *)bc->params, 1104 skl_get_module_params(skl->skl_sst, (u32 *)bc->params,
1105 bc->max, bc->param_id, mconfig); 1105 bc->size, bc->param_id, mconfig);
1106 1106
1107 /* decrement size for TLV header */ 1107 /* decrement size for TLV header */
1108 size -= 2 * sizeof(u32); 1108 size -= 2 * sizeof(u32);
@@ -1136,6 +1136,10 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol,
1136 struct skl *skl = get_skl_ctx(w->dapm->dev); 1136 struct skl *skl = get_skl_ctx(w->dapm->dev);
1137 1137
1138 if (ac->params) { 1138 if (ac->params) {
1139 if (size > ac->max)
1140 return -EINVAL;
1141
1142 ac->size = size;
1139 /* 1143 /*
1140 * if the param_is is of type Vendor, firmware expects actual 1144 * if the param_is is of type Vendor, firmware expects actual
1141 * parameter id and size from the control. 1145 * parameter id and size from the control.
@@ -1151,7 +1155,7 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol,
1151 1155
1152 if (w->power) 1156 if (w->power)
1153 return skl_set_module_params(skl->skl_sst, 1157 return skl_set_module_params(skl->skl_sst,
1154 (u32 *)ac->params, ac->max, 1158 (u32 *)ac->params, ac->size,
1155 ac->param_id, mconfig); 1159 ac->param_id, mconfig);
1156 } 1160 }
1157 1161
@@ -1683,6 +1687,7 @@ static int skl_init_algo_data(struct device *dev, struct soc_bytes_ext *be,
1683 ac->max = dfw_ac->max; 1687 ac->max = dfw_ac->max;
1684 ac->param_id = dfw_ac->param_id; 1688 ac->param_id = dfw_ac->param_id;
1685 ac->set_params = dfw_ac->set_params; 1689 ac->set_params = dfw_ac->set_params;
1690 ac->size = dfw_ac->max;
1686 1691
1687 if (ac->max) { 1692 if (ac->max) {
1688 ac->params = (char *) devm_kzalloc(dev, ac->max, GFP_KERNEL); 1693 ac->params = (char *) devm_kzalloc(dev, ac->max, GFP_KERNEL);
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index e4b399cd7868..28d1d2c68528 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -319,6 +319,7 @@ struct skl_algo_data {
319 u32 param_id; 319 u32 param_id;
320 u32 set_params; 320 u32 set_params;
321 u32 max; 321 u32 max;
322 u32 size;
322 char *params; 323 char *params;
323}; 324};
324 325