aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorKeyon Jie <yang.jie@linux.intel.com>2020-09-04 16:27:36 +0300
committerMark Brown <broonie@kernel.org>2020-09-07 15:16:40 +0100
commitf375bb336df3152360fbcdc4b7c49998d43abd0c (patch)
tree079f91faf316d7eafa72d098fdf54e0f88dbab21 /sound/soc/sof
parentASoC: SOF: append extended data to sof_ipc_comp_dai (diff)
downloadlinux-dev-f375bb336df3152360fbcdc4b7c49998d43abd0c.tar.xz
linux-dev-f375bb336df3152360fbcdc4b7c49998d43abd0c.zip
ASoC: SOF: append extended data to sof_ipc_comp_mixer
Append the extended data to the end of the struct sof_ipc_comp_mixer, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/topology.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index d8732cc5cdeb..eaad7a60f4b2 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1783,19 +1783,16 @@ static int sof_widget_load_mixer(struct snd_soc_component *scomp, int index,
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct snd_soc_tplg_private *private = &tw->priv;
struct sof_ipc_comp_mixer *mixer;
+ size_t ipc_size = sizeof(*mixer);
int ret;
- mixer = kzalloc(sizeof(*mixer), GFP_KERNEL);
+ mixer = (struct sof_ipc_comp_mixer *)
+ sof_comp_alloc(swidget, &ipc_size, index, core);
if (!mixer)
return -ENOMEM;
/* configure mixer IPC message */
- mixer->comp.hdr.size = sizeof(*mixer);
- mixer->comp.hdr.cmd = SOF_IPC_GLB_TPLG_MSG | SOF_IPC_TPLG_COMP_NEW;
- mixer->comp.id = swidget->comp_id;
mixer->comp.type = SOF_COMP_MIXER;
- mixer->comp.pipeline_id = index;
- mixer->comp.core = core;
mixer->config.hdr.size = sizeof(mixer->config);
ret = sof_parse_tokens(scomp, &mixer->config, comp_tokens,
@@ -1813,7 +1810,7 @@ static int sof_widget_load_mixer(struct snd_soc_component *scomp, int index,
swidget->private = mixer;
ret = sof_ipc_tx_message(sdev->ipc, mixer->comp.hdr.cmd, mixer,
- sizeof(*mixer), r, sizeof(*r));
+ ipc_size, r, sizeof(*r));
if (ret < 0)
kfree(mixer);