Skip to contentSkip to conversation

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

PATCH In review Kai Vehmanen 2 participants 3 messages Sep 8, 2020

Subsystems (3)
lore
Share & tools
lore

Kai Vehmanen

author reviewer
#0 lore raw

PATCH 1/2 ASoC: topology: Add support for WO and RO TLV byte kcontrols

From: Dharageswari R <[email protected]>

This patch adds support for write-only and read-only TLV byte kcontrols by checking for appropriate get/put IO handlers.

---
 sound/soc/soc-topology.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
sound/soc/soc-topology.c +4 -3
index cee998671318..28faaf58326e 100644
@@ -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 */
Signature · 1 line
2.27.0
author reviewer
#1 lore raw

PATCH 2/2 ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO

From: Dharageswari R <[email protected]>

This patch implements the snd_sof_bytes_ext_volatile_get() to read the actual parameters from DSP by sending the SOF_IPC_COMP_GET_DATA IPC for the kcontrol of type SOF_TPLG_KCTL_BYTES_VOLATILE_RO.

---
 include/uapi/sound/sof/tokens.h |  3 ++
 sound/soc/sof/control.c         | 58 +++++++++++++++++++++++++++++++++
 sound/soc/sof/sof-audio.h       |  2 ++
 sound/soc/sof/topology.c        |  1 +
 4 files changed, 64 insertions(+)
include/uapi/sound/sof/tokens.h +3 -0
index d3aae4ad8959..a642bf30c027 100644
@@ -24,6 +24,9 @@
 #define SOF_TPLG_KCTL_ENUM_ID	257
 #define SOF_TPLG_KCTL_BYTES_ID	258
 #define SOF_TPLG_KCTL_SWITCH_ID	259
+#define SOF_TPLG_KCTL_BYTES_VOLATILE_RO 260
+#define SOF_TPLG_KCTL_BYTES_VOLATILE_RW 261
+#define SOF_TPLG_KCTL_BYTES_WO_ID 262
 
 /*
  * Tokens - must match values in topology configurations
sound/soc/sof/control.c +58 -0

64 lines not on this page · raw message

sound/soc/sof/sof-audio.h +2 -0
index 196cbd322893..9f645a2e5a6c 100644
@@ -142,6 +142,8 @@ int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
 int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
 			  unsigned int __user *binary_data,
 			  unsigned int size);
+int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int __user *binary_data,
+				   unsigned int size);
 
 /*
  * Topology.
sound/soc/sof/topology.c +1 -0
index 49fae48961a9..d5efac3af5c2 100644
@@ -3688,6 +3688,7 @@ static const struct snd_soc_tplg_kcontrol_ops sof_io_ops[] = {
 /* vendor specific bytes ext handlers available for binding */
 static const struct snd_soc_tplg_bytes_ext_ops sof_bytes_ext_ops[] = {
 	{SOF_TPLG_KCTL_BYTES_ID, snd_sof_bytes_ext_get, snd_sof_bytes_ext_put},
+	{SOF_TPLG_KCTL_BYTES_VOLATILE_RO, snd_sof_bytes_ext_volatile_get},
 };
 
 static struct snd_soc_tplg_ops sof_tplg_ops = {
Signature · 1 line
2.27.0
maintainer
#2 lore raw
In reply to Kai Vehmanen
Quoted 2 lines · Kai Vehmanen

This patch adds support for write-only and read-only TLV byte kcontrols by checking for appropriate get/put IO handlers.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: topology: Add support for WO and RO TLV byte kcontrols

      commit: 819b9f6002391925b53817ed96638bd40bd1d34f
[2/2] ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO
      commit: 783560d02dd61aee20d1d00c1c061bcafea30264

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark