aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBard Liao <[email protected]>2024-02-13 14:30:07 +0200
committerMark Brown <[email protected]>2024-02-13 14:23:00 +0000
commite49676a5fc83e5d396f45ce4b90ca9c44736c69a (patch)
tree5ded3c494cd1e3ded34f7cbc4440e81f5b6a55d5
parent20c0c9b352df1ab7915c827cb1d182bfc32f9f46 (diff)
ASoC: SOF: ipc4-topology: set config_length based on device_count
Set ipc4_copier->data.gtw_cfg.config_length dynamically based on blob->alh_cfg.device_count to align with the other OS. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/sof/ipc4-topology.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index f779156fe0e6..1dc935d737dd 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -598,7 +598,11 @@ static int sof_ipc4_widget_setup_comp_dai(struct snd_sof_widget *swidget)
}
ipc4_copier->copier_config = (uint32_t *)blob;
- ipc4_copier->data.gtw_cfg.config_length = sizeof(*blob) >> 2;
+ /* set data.gtw_cfg.config_length based on device_count */
+ ipc4_copier->data.gtw_cfg.config_length = (sizeof(blob->gw_attr) +
+ sizeof(blob->alh_cfg.device_count) +
+ sizeof(*blob->alh_cfg.mapping) *
+ blob->alh_cfg.device_count) >> 2;
break;
}
case SOF_DAI_INTEL_SSP: