Commit 819b9f60 authored by Dharageswari R's avatar Dharageswari R Committed by Mark Brown

ASoC: topology: Add support for WO and RO TLV byte kcontrols

This patch adds support for write-only and read-only TLV byte kcontrols
by checking for appropriate get/put IO handlers.
Signed-off-by: default avatarDharageswari R <dharageswari.r@intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200908092825.1813847-1-kai.vehmanen@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 34ce4100
......@@ -603,10 +603,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
sbe->get = ext_ops[i].get;
}
if (sbe->put && sbe->get)
return 0;
else
if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) && !sbe->get)
return -EINVAL;
if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) && !sbe->put)
return -EINVAL;
return 0;
}
/* try and map vendor specific kcontrol handlers first */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment