[PATCH 2/4] ASoC: sof: Add domain_id, heap_bytes and stack_bytes to snd_sof_widget

Peter Ujfalusi
2026-01-12T11:31:52Z

Add dp_domain_id, dp_heap_bytes and dp_stack_bytes to struct
snd_sof_widget and fill the values from topology tuples with
SOF_TKN_COMP_DOMAIN_ID, SOF_TKN_COMP_STACK_BYTES_REQUIREMENT and
SOF_TKN_COMP_HEAP_BYTES_REQUIREMENT tokens.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
sound/soc/sof/ipc4-topology.c | 6 ++++++
sound/soc/sof/sof-audio.h | 5 +++++
2 files changed, 11 insertions(+)

diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 479772dc466a..a14023c4c3e7 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -158,6 +158,12 @@ static const struct sof_topology_token comp_ext_tokens[] = {
offsetof(struct snd_sof_widget, core)},
{SOF_TKN_COMP_SCHED_DOMAIN, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_domain,
offsetof(struct snd_sof_widget, comp_domain)},
+ {SOF_TKN_COMP_DOMAIN_ID, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+ offsetof(struct snd_sof_widget, dp_domain_id)},
+ {SOF_TKN_COMP_HEAP_BYTES_REQUIREMENT, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+ offsetof(struct snd_sof_widget, dp_heap_bytes)},
+ {SOF_TKN_COMP_STACK_BYTES_REQUIREMENT, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+ offsetof(struct snd_sof_widget, dp_stack_bytes)},
};

static const struct sof_topology_token gain_tokens[] = {
diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h
index a8b93a2eec9c..03c8dd29e071 100644
--- a/sound/soc/sof/sof-audio.h
+++ b/sound/soc/sof/sof-audio.h
@@ -454,6 +454,11 @@ struct snd_sof_widget {
/* Scheduling domain (enum sof_comp_domain), unset, Low Latency, or Data Processing */
u32 comp_domain;

+ /* The values below are added to mod_init pay load if comp_domain indicates DP component */
+ u32 dp_domain_id; /* DP process userspace domain ID */
+ u32 dp_stack_bytes; /* DP process stack size requirement in bytes */
+ u32 dp_heap_bytes; /* DP process heap size requirement in bytes */
+
struct snd_soc_dapm_widget *widget;
struct list_head list; /* list in sdev widget list */
struct snd_sof_pipeline *spipe;
--
2.52.0