diff options
author | Kamil Lulko <kamilx.lulko@intel.com> | 2019-06-13 15:04:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-06-25 10:33:57 -0400 |
commit | a8cd7066f0422f378902770034ddac1720d0e032 (patch) | |
tree | 466919772aff7b905d7546916d34733beb8be9db | |
parent | 02923faa6b29ac0423f1d5ff8c13c5eeb4e5669b (diff) |
ASoC: Intel: Skylake: Strip T and L from TLV IPCs
cAVS modules do not require Type and Length header within the
set_module_params IPC. This is also true for Vendor modules. The
userspace (like tinymix) always appends this header to TLV controls
which are used for set_module_params. Simply assume this header is
always present in the payload and omit it from the IPC.
Signed-off-by: Kamil Lulko <kamilx.lulko@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 99825dda34af..c353eb14ce36 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c | |||
@@ -1492,22 +1492,18 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol, | |||
1492 | struct skl *skl = get_skl_ctx(w->dapm->dev); | 1492 | struct skl *skl = get_skl_ctx(w->dapm->dev); |
1493 | 1493 | ||
1494 | if (ac->params) { | 1494 | if (ac->params) { |
1495 | /* | ||
1496 | * Widget data is expected to be stripped of T and L | ||
1497 | */ | ||
1498 | size -= 2 * sizeof(unsigned int); | ||
1499 | data += 2; | ||
1500 | |||
1495 | if (size > ac->max) | 1501 | if (size > ac->max) |
1496 | return -EINVAL; | 1502 | return -EINVAL; |
1497 | |||
1498 | ac->size = size; | 1503 | ac->size = size; |
1499 | /* | 1504 | |
1500 | * if the param_is is of type Vendor, firmware expects actual | 1505 | if (copy_from_user(ac->params, data, size)) |
1501 | * parameter id and size from the control. | 1506 | return -EFAULT; |
1502 | */ | ||
1503 | if (ac->param_id == SKL_PARAM_VENDOR_ID) { | ||
1504 | if (copy_from_user(ac->params, data, size)) | ||
1505 | return -EFAULT; | ||
1506 | } else { | ||
1507 | if (copy_from_user(ac->params, | ||
1508 | data + 2, size)) | ||
1509 | return -EFAULT; | ||
1510 | } | ||
1511 | 1507 | ||
1512 | if (w->power) | 1508 | if (w->power) |
1513 | return skl_set_module_params(skl->skl_sst, | 1509 | return skl_set_module_params(skl->skl_sst, |