summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ipc4-topology.h
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2023-03-13 14:48:52 +0200
committerMark Brown <broonie@kernel.org>2023-03-13 14:08:26 +0000
commit7ab6b1e8302cf7a9bc8808c43b3e751e4148a351 (patch)
tree68c29d376caae64f32720e39c73eaab297f78c78 /sound/soc/sof/ipc4-topology.h
parent8abc9ab956b5756693710e1e09557e0189f01bef (diff)
downloadlinux-stable-7ab6b1e8302cf7a9bc8808c43b3e751e4148a351.tar.gz
linux-stable-7ab6b1e8302cf7a9bc8808c43b3e751e4148a351.tar.bz2
linux-stable-7ab6b1e8302cf7a9bc8808c43b3e751e4148a351.zip
ASoC: SOF: ipc4-topology: Modify the type of available input/output formats
Introduce a new struct sof_ipc4_pin_format which contains the pin index and the buffer size. Replace the type of available input/output audio formats in struct sof_ipc4_available_audio_format with this new struct type and rename them to input_pin_fmts and output_pin_fmts. Also, add a new token, SOF_TKN_CAVS_AUDIO_FORMAT_PIN_INDEX that will be used to parse the pin index for the audio format from topology. Currently we only set the audio format for Pin 0 in topology, so the default value will be 0 for all audio formats. Finally, parse the pin_index and the input/output buffer sizes along with audio formats into the pin_format arrays in struct sof_ipc4_available_audio_format. This makes the base_config array in struct sof_ipc4_available_audio_format redundant. So remove it. This change will allow the addition of audio formats for the non-zero pins in topology transparent to the topology parser in the kernel. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@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> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230313124856.8140-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc4-topology.h')
-rw-r--r--sound/soc/sof/ipc4-topology.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/sound/soc/sof/ipc4-topology.h b/sound/soc/sof/ipc4-topology.h
index 696d6c39a21b..2d9b1ba549f7 100644
--- a/sound/soc/sof/ipc4-topology.h
+++ b/sound/soc/sof/ipc4-topology.h
@@ -146,18 +146,31 @@ struct ipc4_pipeline_set_state_data {
} __packed;
/**
+ * struct sof_ipc4_pin_format - Module pin format
+ * @pin_index: pin index
+ * @buffer_size: buffer size in bytes
+ * @audio_fmt: audio format for the pin
+ *
+ * This structure can be used for both output or input pins and the pin_index is relative to the
+ * pin type i.e output/input pin
+ */
+struct sof_ipc4_pin_format {
+ u32 pin_index;
+ u32 buffer_size;
+ struct sof_ipc4_audio_format audio_fmt;
+};
+
+/**
* struct sof_ipc4_available_audio_format - Available audio formats
- * @base_config: Available base config
- * @out_audio_fmt: Available output audio format
- * @input_audio_fmts: Available input audio formats
+ * @output_pin_fmts: Available output pin formats
+ * @input_pin_fmts: Available input pin formats
* @ref_audio_fmt: Reference audio format to match runtime audio format
* @audio_fmt_num: Number of available audio formats
*/
struct sof_ipc4_available_audio_format {
- struct sof_ipc4_base_module_cfg *base_config;
- struct sof_ipc4_audio_format *out_audio_fmt;
- struct sof_ipc4_audio_format *input_audio_fmts;
- struct sof_ipc4_audio_format *ref_audio_fmt;
+ struct sof_ipc4_pin_format *output_pin_fmts;
+ struct sof_ipc4_pin_format *input_pin_fmts;
+ struct sof_ipc4_pin_format *ref_audio_fmt;
int audio_fmt_num;
};