diff mbox series

[02/10] ASoC: topology: Save num_channels value for mixer controls

Message ID 20250217102115.3539427-3-cezary.rojewski@intel.com (mailing list archive)
State New
Headers show
Series ASoC: Intel: avs: Mute and multi-channel controls support | expand

Commit Message

Cezary Rojewski Feb. 17, 2025, 10:21 a.m. UTC
To provide minimal support for multi-channel kcontrols i.e.: more than
stereo configuration, store the number of channels specified within the
SectionControlMixer. The field is part of the topology standard,
currently skipped by the ASoC core.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 include/sound/soc.h      | 1 +
 sound/soc/soc-topology.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 16e4e488521c..8931c24d9bb9 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1265,6 +1265,7 @@  struct soc_mixer_control {
 	int min, max, platform_max;
 	int reg, rreg;
 	unsigned int shift, rshift;
+	u32 num_channels;
 	unsigned int sign_bit;
 	unsigned int invert:1;
 	unsigned int autodisable:1;
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 921521a84e29..2b86cc3311f7 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -669,6 +669,7 @@  static int soc_tplg_control_dmixer_create(struct soc_tplg *tplg, struct snd_kcon
 	sm->min = le32_to_cpu(mc->min);
 	sm->invert = le32_to_cpu(mc->invert);
 	sm->platform_max = le32_to_cpu(mc->platform_max);
+	sm->num_channels = le32_to_cpu(mc->num_channels);
 
 	/* map io handlers */
 	err = soc_tplg_kcontrol_bind_io(&mc->hdr, kc, tplg);