diff mbox series

[01/18] ASoC: SOF: Introduce struct snd_sof_dai_link

Message ID 20220314200520.1233427-2-ranjani.sridharan@linux.intel.com
State Accepted
Commit 0af0f4633adfa211807262af4d446b09698df6c8
Headers show
Series Introduce IPC abstraction for SOF topology parsing | expand

Commit Message

Ranjani Sridharan March 14, 2022, 8:05 p.m. UTC
Introduce a new struct for DAI links to save the DAI link information
parsed from topology. Also add a list of dai_links to struct snd_sof_dev
that will be populated during topology parsing.

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>
---
 sound/soc/sof/core.c      |  1 +
 sound/soc/sof/sof-audio.h | 21 ++++++++++++++++++++-
 sound/soc/sof/sof-priv.h  |  1 +
 3 files changed, 22 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 9217644e2eab..e91631618bff 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -370,6 +370,7 @@  int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
 	INIT_LIST_HEAD(&sdev->kcontrol_list);
 	INIT_LIST_HEAD(&sdev->widget_list);
 	INIT_LIST_HEAD(&sdev->dai_list);
+	INIT_LIST_HEAD(&sdev->dai_link_list);
 	INIT_LIST_HEAD(&sdev->route_list);
 	INIT_LIST_HEAD(&sdev->ipc_client_list);
 	INIT_LIST_HEAD(&sdev->ipc_rx_handler_list);
diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h
index 450ee9977c55..548d443e83b0 100644
--- a/sound/soc/sof/sof-audio.h
+++ b/sound/soc/sof/sof-audio.h
@@ -96,7 +96,26 @@  struct snd_sof_control {
 	bool comp_data_dirty;
 };
 
-struct snd_sof_widget;
+/** struct snd_sof_dai_link - DAI link info
+ * @tuples: array of parsed tuples
+ * @num_tuples: number of tuples in the tuples array
+ * @link: Pointer to snd_soc_dai_link
+ * @hw_configs: Pointer to hw configs in topology
+ * @num_hw_configs: Number of hw configs in topology
+ * @default_hw_cfg_id: Default hw config ID
+ * @type: DAI type
+ * @list: item in snd_sof_dev dai_link list
+ */
+struct snd_sof_dai_link {
+	struct snd_sof_tuple *tuples;
+	int num_tuples;
+	struct snd_soc_dai_link *link;
+	struct snd_soc_tplg_hw_config *hw_configs;
+	int num_hw_configs;
+	int default_hw_cfg_id;
+	int type;
+	struct list_head list;
+};
 
 /* ASoC SOF DAPM widget */
 struct snd_sof_widget {
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index ef5a2adae5c7..28d3f1ac8be8 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -441,6 +441,7 @@  struct snd_sof_dev {
 	struct list_head kcontrol_list;
 	struct list_head widget_list;
 	struct list_head dai_list;
+	struct list_head dai_link_list;
 	struct list_head route_list;
 	struct snd_soc_component *component;
 	u32 enabled_cores_mask; /* keep track of enabled cores */