Skip to content

Commit 74f7971

Browse files
Amadeusz Sławińskigregkh
authored andcommitted
ASoC: topology: Allow TLV control to be either read or write
commit feb00b7 upstream. There is no reason to force readwrite access on TLV controls. It can be either read, write or both. This is further evidenced in code where it performs following checks: 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; Fixes: 1a3232d ("ASoC: topology: Add support for TLV bytes controls") Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220112170030.569712-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3ca4755 commit 74f7971

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sound/soc/soc-topology.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
578578

579579
if (le32_to_cpu(hdr->ops.info) == SND_SOC_TPLG_CTL_BYTES
580580
&& k->iface & SNDRV_CTL_ELEM_IFACE_MIXER
581-
&& k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE
581+
&& (k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ
582+
|| k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
582583
&& k->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
583584
struct soc_bytes_ext *sbe;
584585
struct snd_soc_tplg_bytes_control *be;

0 commit comments

Comments
 (0)