summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/sof-audio.h
diff options
context:
space:
mode:
authorChao Song <chao.song@linux.intel.com>2022-11-07 09:57:05 +0100
committerMark Brown <broonie@kernel.org>2022-11-07 14:58:10 +0100
commit3b3acedbd0f30b822e05e5e51b646a67de0031fc (patch)
tree7cdd31b28d70acf4daf2710252ffe73917dfa093 /sound/soc/sof/sof-audio.h
parentASoC: SOF: Add support for parsing the number of sink/source pins (diff)
downloadlinux-3b3acedbd0f30b822e05e5e51b646a67de0031fc.tar.xz
linux-3b3acedbd0f30b822e05e5e51b646a67de0031fc.zip
ASoC: SOF: Add support to parse pin binding array from topology
Add support for parsing sink/source pin binding array per widget from topology. The pin binding arrays will be used to determine the source and sink queue IDs during widget binding for widget that requires special pin binding. An example of widget that requires special pin binding is the smart amplifier widget, its feedback sink pin has to be connected to a capture DAI copier for codec feedback, while the other sink pin has to be connected to a host DAI copier. Pin ID is required during widget binding for correct route setup. Conversely, the pin ID for 'generic' pins is not defined in the topology and will be allocated by the kernel dynamically. When only one pin is supported, the pin ID shall always be zero. When more than one pin is supported, the pin ID is determined with the ID allocation mechanism in the kernel. Signed-off-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20221107085706.2550-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-audio.h')
-rw-r--r--sound/soc/sof/sof-audio.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h
index dfca713f00df..efc80a5febc3 100644
--- a/sound/soc/sof/sof-audio.h
+++ b/sound/soc/sof/sof-audio.h
@@ -30,6 +30,10 @@
*/
#define SOF_WIDGET_MAX_NUM_PINS 8
+/* The type of a widget pin is either sink or source */
+#define SOF_PIN_TYPE_SINK 0
+#define SOF_PIN_TYPE_SOURCE 1
+
/* max number of FE PCMs before BEs */
#define SOF_BE_PCM_BASE 16
@@ -402,6 +406,22 @@ struct snd_sof_widget {
u32 num_sink_pins;
u32 num_source_pins;
+ /*
+ * The sink/source pin binding array, it takes the form of
+ * [widget_name_connected_to_pin0, widget_name_connected_to_pin1, ...],
+ * with the index as the queue ID.
+ *
+ * The array is used for special pin binding. Note that even if there
+ * is only one sink/source pin requires special pin binding, pin binding
+ * should be defined for all sink/source pins in topology, for pin(s) that
+ * are not used, give the value "NotConnected".
+ *
+ * If pin binding is not defined in topology, nothing to parse in the kernel,
+ * sink_pin_binding and src_pin_binding shall be NULL.
+ */
+ char **sink_pin_binding;
+ char **src_pin_binding;
+
void *private; /* core does not touch this */
};
@@ -546,6 +566,7 @@ int get_token_u16(void *elem, void *object, u32 offset);
int get_token_comp_format(void *elem, void *object, u32 offset);
int get_token_dai_type(void *elem, void *object, u32 offset);
int get_token_uuid(void *elem, void *object, u32 offset);
+int get_token_string(void *elem, void *object, u32 offset);
int sof_update_ipc_object(struct snd_soc_component *scomp, void *object, enum sof_tokens token_id,
struct snd_sof_tuple *tuples, int num_tuples,
size_t object_size, int token_instance_num);