diff options
author | Ranjani Sridharan <ranjani.sridharan@linux.intel.com> | 2022-03-14 21:05:11 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-03-16 17:39:03 +0100 |
commit | 683b54ef603825328859d867aabf9a6d973238a2 (patch) | |
tree | 8b071cca9cb70ba8f1e8c95583e29ea82dc7922d /sound/soc/sof/topology.c | |
parent | ASoC: SOF: topology: Make mixer widget parsing IPC agnostic (diff) | |
download | linux-683b54ef603825328859d867aabf9a6d973238a2.tar.xz linux-683b54ef603825328859d867aabf9a6d973238a2.zip |
ASoC: SOF: topology: Make mux/demux widget parsing IPC agnostic
Define the list of tokens pertaining to the mux/demux widgets, parse and
save them as part of the swidget tuples array. Once topology parsing is
complete, these tokens will be applied to create the IPC structure for the
mux/demux component based on the topology widget_setup op in ipc3_tplg_ops.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220314200520.1233427-11-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | sound/soc/sof/topology.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 9e9a41018458..42da7b8e7180 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1793,44 +1793,6 @@ err: } /* - * Mux topology - */ -static int sof_widget_load_mux(struct snd_soc_component *scomp, int index, - struct snd_sof_widget *swidget, - struct snd_soc_tplg_dapm_widget *tw) -{ - struct snd_soc_tplg_private *private = &tw->priv; - struct sof_ipc_comp_mux *mux; - size_t ipc_size = sizeof(*mux); - int ret; - - mux = (struct sof_ipc_comp_mux *) - sof_comp_alloc(swidget, &ipc_size, index); - if (!mux) - return -ENOMEM; - - /* configure mux IPC message */ - mux->comp.type = SOF_COMP_MUX; - mux->config.hdr.size = sizeof(mux->config); - - ret = sof_parse_tokens(scomp, &mux->config, comp_tokens, - ARRAY_SIZE(comp_tokens), private->array, - le32_to_cpu(private->size)); - if (ret != 0) { - dev_err(scomp->dev, "error: parse mux.cfg tokens failed %d\n", - private->size); - kfree(mux); - return ret; - } - - sof_dbg_comp_config(scomp, &mux->config); - - swidget->private = mux; - - return 0; -} - -/* * SRC Topology */ @@ -2316,6 +2278,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, case snd_soc_dapm_scheduler: case snd_soc_dapm_aif_out: case snd_soc_dapm_aif_in: + case snd_soc_dapm_mux: + case snd_soc_dapm_demux: ret = sof_widget_parse_tokens(scomp, swidget, tw, token_list, token_list_size); break; case snd_soc_dapm_src: @@ -2330,10 +2294,6 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, case snd_soc_dapm_effect: ret = sof_widget_load_process(scomp, index, swidget, tw); break; - case snd_soc_dapm_mux: - case snd_soc_dapm_demux: - ret = sof_widget_load_mux(scomp, index, swidget, tw); - break; case snd_soc_dapm_switch: case snd_soc_dapm_dai_link: case snd_soc_dapm_kcontrol: |