summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/topology.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2021-12-15 10:03:59 -0800
committerMark Brown <broonie@kernel.org>2021-12-15 22:16:42 +0000
commit8af783723f41d3b3d4f7f8452f190405e7059472 (patch)
tree66306b6e567a6c41f4c84b3c6f11621f82e5f568 /sound/soc/sof/topology.c
parentd4a06c4334aed1fe76ae2b7aaae6ee8b72f30a8e (diff)
downloadlinux-stable-8af783723f41d3b3d4f7f8452f190405e7059472.tar.gz
linux-stable-8af783723f41d3b3d4f7f8452f190405e7059472.tar.bz2
linux-stable-8af783723f41d3b3d4f7f8452f190405e7059472.zip
ASoC: SOF: topology: Set control_data->cmd alongside scontrol->cmd
Set the scontrol->control_data->cmd early to the same as scontrol->cmd. This is a preparatory patch to remove the ctrl_cmd parameter for the snd_sof_ipc_set_get_comp_data() function. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20211215180404.53254-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/topology.c')
-rw-r--r--sound/soc/sof/topology.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index b3ad3a604918..c440e1c53ca5 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1091,10 +1091,12 @@ static int sof_control_load_volume(struct snd_soc_component *scomp,
/* set cmd for mixer control */
if (le32_to_cpu(mc->max) == 1) {
scontrol->cmd = SOF_CTRL_CMD_SWITCH;
+ scontrol->control_data->cmd = scontrol->cmd;
goto skip;
}
scontrol->cmd = SOF_CTRL_CMD_VOLUME;
+ scontrol->control_data->cmd = scontrol->cmd;
/* extract tlv data */
if (!kc->tlv.p || get_tlv_data(kc->tlv.p, tlv) < 0) {
@@ -1166,6 +1168,7 @@ static int sof_control_load_enum(struct snd_soc_component *scomp,
scontrol->num_channels = le32_to_cpu(ec->num_channels);
scontrol->control_data->index = kc->index;
scontrol->cmd = SOF_CTRL_CMD_ENUM;
+ scontrol->control_data->cmd = scontrol->cmd;
dev_dbg(scomp->dev, "tplg: load kcontrol index %d chans %d comp_id %d\n",
scontrol->comp_id, scontrol->num_channels, scontrol->comp_id);
@@ -1212,6 +1215,7 @@ static int sof_control_load_bytes(struct snd_soc_component *scomp,
scontrol->comp_id = sdev->next_comp_id;
scontrol->cmd = SOF_CTRL_CMD_BINARY;
+ scontrol->control_data->cmd = scontrol->cmd;
scontrol->control_data->index = kc->index;
dev_dbg(scomp->dev, "tplg: load kcontrol index %d chans %d\n",