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>
This commit is contained in:
parent
02923faa6b
commit
a8cd7066f0
1 changed files with 9 additions and 13 deletions
|
@ -1492,22 +1492,18 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol,
|
||||||
struct skl *skl = get_skl_ctx(w->dapm->dev);
|
struct skl *skl = get_skl_ctx(w->dapm->dev);
|
||||||
|
|
||||||
if (ac->params) {
|
if (ac->params) {
|
||||||
|
/*
|
||||||
|
* Widget data is expected to be stripped of T and L
|
||||||
|
*/
|
||||||
|
size -= 2 * sizeof(unsigned int);
|
||||||
|
data += 2;
|
||||||
|
|
||||||
if (size > ac->max)
|
if (size > ac->max)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ac->size = size;
|
ac->size = size;
|
||||||
/*
|
|
||||||
* if the param_is is of type Vendor, firmware expects actual
|
if (copy_from_user(ac->params, data, size))
|
||||||
* parameter id and size from the control.
|
return -EFAULT;
|
||||||
*/
|
|
||||||
if (ac->param_id == SKL_PARAM_VENDOR_ID) {
|
|
||||||
if (copy_from_user(ac->params, data, size))
|
|
||||||
return -EFAULT;
|
|
||||||
} else {
|
|
||||||
if (copy_from_user(ac->params,
|
|
||||||
data + 2, size))
|
|
||||||
return -EFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (w->power)
|
if (w->power)
|
||||||
return skl_set_module_params(skl->skl_sst,
|
return skl_set_module_params(skl->skl_sst,
|
||||||
|
|
Loading…
Add table
Reference in a new issue