Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: ipc4-topology: Add new tokens for pipeline direction

Parse the pipeline direction from topology. The direction_valid token is
required for backward-compatibility with older topologies that may not
have the direction set for pipelines. This will be used when
setting up pipelines to check if a pipeline is in the same direction as
the requested params and skip those in the opposite direction like in
the case of echo reference capture pipelines during playback.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20260204081833.16630-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Ranjani Sridharan and committed by
Mark Brown
15a55ec2 e614fce9

+21 -2
+2
include/uapi/sound/sof/tokens.h
··· 57 57 #define SOF_TKN_SCHED_MEM_USAGE 208 58 58 #define SOF_TKN_SCHED_USE_CHAIN_DMA 209 59 59 #define SOF_TKN_SCHED_KCPS 210 60 + #define SOF_TKN_SCHED_DIRECTION 211 61 + #define SOF_TKN_SCHED_DIRECTION_VALID 212 60 62 61 63 /* volume */ 62 64 #define SOF_TKN_VOLUME_RAMP_STEP_TYPE 250
+10 -2
sound/soc/sof/ipc4-topology.c
··· 76 76 offsetof(struct sof_ipc4_pipeline, core_id)}, 77 77 {SOF_TKN_SCHED_PRIORITY, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 78 78 offsetof(struct sof_ipc4_pipeline, priority)}, 79 + {SOF_TKN_SCHED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 80 + offsetof(struct sof_ipc4_pipeline, direction)}, 81 + {SOF_TKN_SCHED_DIRECTION, SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16, 82 + offsetof(struct sof_ipc4_pipeline, direction_valid)}, 79 83 }; 80 84 81 85 static const struct sof_topology_token pipeline_tokens[] = { ··· 943 939 944 940 swidget->core = pipeline->core_id; 945 941 spipe->core_mask |= BIT(pipeline->core_id); 942 + if (pipeline->direction_valid) { 943 + spipe->direction = pipeline->direction; 944 + spipe->direction_valid = true; 945 + } 946 946 947 947 if (pipeline->use_chain_dma) { 948 948 dev_dbg(scomp->dev, "Set up chain DMA for %s\n", swidget->widget->name); ··· 962 954 goto err; 963 955 } 964 956 965 - dev_dbg(scomp->dev, "pipeline '%s': id %d, pri %d, core_id %u, lp mode %d\n", 957 + dev_dbg(scomp->dev, "pipeline '%s': id %d, pri %d, core_id %u, lp mode %d direction %d\n", 966 958 swidget->widget->name, swidget->pipeline_id, 967 - pipeline->priority, pipeline->core_id, pipeline->lp_mode); 959 + pipeline->priority, pipeline->core_id, pipeline->lp_mode, pipeline->direction); 968 960 969 961 swidget->private = pipeline; 970 962
+4
sound/soc/sof/ipc4-topology.h
··· 150 150 * @use_chain_dma: flag to indicate if the firmware shall use chained DMA 151 151 * @msg: message structure for pipeline 152 152 * @skip_during_fe_trigger: skip triggering this pipeline during the FE DAI trigger 153 + * @direction_valid: flag indicating if valid direction is set in topology 154 + * @direction: pipeline direction set in topology if direction_valid is true 153 155 */ 154 156 struct sof_ipc4_pipeline { 155 157 uint32_t priority; ··· 162 160 bool use_chain_dma; 163 161 struct sof_ipc4_msg msg; 164 162 bool skip_during_fe_trigger; 163 + bool direction_valid; 164 + u32 direction; 165 165 }; 166 166 167 167 /**
+5
sound/soc/sof/sof-audio.h
··· 512 512 * @complete: flag used to indicate that pipeline set up is complete. 513 513 * @core_mask: Mask containing target cores for all modules in the pipeline 514 514 * @list: List item in sdev pipeline_list 515 + * @direction_valid: flag indicating if the direction is set in topology 516 + * @direction: pipeline direction set in topology, valid is direction_valid is true 517 + * 515 518 */ 516 519 struct snd_sof_pipeline { 517 520 struct snd_sof_widget *pipe_widget; ··· 523 520 int complete; 524 521 unsigned long core_mask; 525 522 struct list_head list; 523 + bool direction_valid; 524 + u32 direction; 526 525 }; 527 526 528 527 /* ASoC SOF DAPM route */