diff mbox series

[3/6] ASoC: SOF: ipc4-topology: add base module config extension structure

Message ID 20230316151137.7598-4-peter.ujfalusi@linux.intel.com (mailing list archive)
State Accepted
Commit d0be868c5a6e0dafb53d0ee9f0b9d66e40d963f6
Headers show
Series ASoC: SOF: ipc4-topology: Add support for effect widget | expand

Commit Message

Peter Ujfalusi March 16, 2023, 3:11 p.m. UTC
From: Chao Song <chao.song@linux.intel.com>

The modules currently supported by the SOF firmware use the base module
config containing the audio format for the input/output pin 0 for
initialization. But some processing modules with multiple input/output
pins require the audio formats to be sent with the init instance IPC
payload. Modules that require the base config extension will need to
indicate this in the module information in the firmware manifest.

Introduce a new struct sof_ipc4_base_module_cfg_ext which contains the
pin formats for the input and output pins. This will be appended to the
init instance IPC payload for modules that require it.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 sound/soc/sof/ipc4-topology.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/sof/ipc4-topology.h b/sound/soc/sof/ipc4-topology.h
index 9fcb978ebc63..97264454b8a6 100644
--- a/sound/soc/sof/ipc4-topology.h
+++ b/sound/soc/sof/ipc4-topology.h
@@ -347,6 +347,23 @@  struct sof_ipc4_src {
 	struct sof_ipc4_msg msg;
 };
 
+/**
+ * struct sof_ipc4_base_module_cfg_ext - base module config extension containing the pin format
+ * information for the module. Both @num_input_pin_fmts and @num_output_pin_fmts cannot be 0 for a
+ * module.
+ * @num_input_pin_fmts: number of input pin formats in the @pin_formats array
+ * @num_output_pin_fmts: number of output pin formats in the @pin_formats array
+ * @reserved: reserved for future use
+ * @pin_formats: flexible array consisting of @num_input_pin_fmts input pin format items followed
+ *		 by @num_output_pin_fmts output pin format items
+ */
+struct sof_ipc4_base_module_cfg_ext {
+	u16 num_input_pin_fmts;
+	u16 num_output_pin_fmts;
+	u8 reserved[12];
+	DECLARE_FLEX_ARRAY(struct sof_ipc4_pin_format, pin_formats);
+} __packed;
+
 /**
  * struct sof_ipc4_process - process config data
  * @base_config: IPC base config data