Skip to content

Commit 6558e87

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc4-topology: Use single token list for the copiers
There is no need to keep separate token list for dai and 'common' copier token list when the 'common' list is actually the aif list, the SOF_COPIER_DEEP_BUFFER_TOKENS are not applicable for buffers. We could have separate lists for all types but it is probably simpler to just use a single list for all types of copiers. Function specific tokens will be only parsed by function specific code anyways. Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3b628e6 commit 6558e87

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

sound/soc/sof/ipc4-topology.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,31 +3307,24 @@ static int sof_ipc4_link_setup(struct snd_sof_dev *sdev, struct snd_soc_dai_link
33073307
return 0;
33083308
}
33093309

3310-
static enum sof_tokens common_copier_token_list[] = {
3310+
/* Tokens needed for different copier variants (aif, dai and buffer) */
3311+
static enum sof_tokens copier_token_list[] = {
33113312
SOF_COMP_TOKENS,
3313+
SOF_COPIER_TOKENS,
33123314
SOF_AUDIO_FMT_NUM_TOKENS,
33133315
SOF_IN_AUDIO_FORMAT_TOKENS,
33143316
SOF_OUT_AUDIO_FORMAT_TOKENS,
3315-
SOF_COPIER_DEEP_BUFFER_TOKENS,
3316-
SOF_COPIER_TOKENS,
33173317
SOF_COMP_EXT_TOKENS,
3318+
3319+
SOF_COPIER_DEEP_BUFFER_TOKENS, /* for AIF copier */
3320+
SOF_DAI_TOKENS, /* for DAI copier */
33183321
};
33193322

33203323
static enum sof_tokens pipeline_token_list[] = {
33213324
SOF_SCHED_TOKENS,
33223325
SOF_PIPELINE_TOKENS,
33233326
};
33243327

3325-
static enum sof_tokens dai_token_list[] = {
3326-
SOF_COMP_TOKENS,
3327-
SOF_AUDIO_FMT_NUM_TOKENS,
3328-
SOF_IN_AUDIO_FORMAT_TOKENS,
3329-
SOF_OUT_AUDIO_FORMAT_TOKENS,
3330-
SOF_COPIER_TOKENS,
3331-
SOF_DAI_TOKENS,
3332-
SOF_COMP_EXT_TOKENS,
3333-
};
3334-
33353328
static enum sof_tokens pga_token_list[] = {
33363329
SOF_COMP_TOKENS,
33373330
SOF_GAIN_TOKENS,
@@ -3368,23 +3361,23 @@ static enum sof_tokens process_token_list[] = {
33683361

33693362
static const struct sof_ipc_tplg_widget_ops tplg_ipc4_widget_ops[SND_SOC_DAPM_TYPE_COUNT] = {
33703363
[snd_soc_dapm_aif_in] = {sof_ipc4_widget_setup_pcm, sof_ipc4_widget_free_comp_pcm,
3371-
common_copier_token_list, ARRAY_SIZE(common_copier_token_list),
3364+
copier_token_list, ARRAY_SIZE(copier_token_list),
33723365
NULL, sof_ipc4_prepare_copier_module,
33733366
sof_ipc4_unprepare_copier_module},
33743367
[snd_soc_dapm_aif_out] = {sof_ipc4_widget_setup_pcm, sof_ipc4_widget_free_comp_pcm,
3375-
common_copier_token_list, ARRAY_SIZE(common_copier_token_list),
3368+
copier_token_list, ARRAY_SIZE(copier_token_list),
33763369
NULL, sof_ipc4_prepare_copier_module,
33773370
sof_ipc4_unprepare_copier_module},
33783371
[snd_soc_dapm_dai_in] = {sof_ipc4_widget_setup_comp_dai, sof_ipc4_widget_free_comp_dai,
3379-
dai_token_list, ARRAY_SIZE(dai_token_list), NULL,
3372+
copier_token_list, ARRAY_SIZE(copier_token_list), NULL,
33803373
sof_ipc4_prepare_copier_module,
33813374
sof_ipc4_unprepare_copier_module},
33823375
[snd_soc_dapm_dai_out] = {sof_ipc4_widget_setup_comp_dai, sof_ipc4_widget_free_comp_dai,
3383-
dai_token_list, ARRAY_SIZE(dai_token_list), NULL,
3376+
copier_token_list, ARRAY_SIZE(copier_token_list), NULL,
33843377
sof_ipc4_prepare_copier_module,
33853378
sof_ipc4_unprepare_copier_module},
33863379
[snd_soc_dapm_buffer] = {sof_ipc4_widget_setup_pcm, sof_ipc4_widget_free_comp_pcm,
3387-
common_copier_token_list, ARRAY_SIZE(common_copier_token_list),
3380+
copier_token_list, ARRAY_SIZE(copier_token_list),
33883381
NULL, sof_ipc4_prepare_copier_module,
33893382
sof_ipc4_unprepare_copier_module},
33903383
[snd_soc_dapm_scheduler] = {sof_ipc4_widget_setup_comp_pipeline,

0 commit comments

Comments
 (0)