aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/generic/simple-card-utils.c
diff options
context:
space:
mode:
authorDaniel Baluta <[email protected]>2023-11-28 10:11:18 +0200
committerMark Brown <[email protected]>2023-12-14 10:56:47 +0000
commitd29351e8c20d61a852bbdfcab7bb7166bd916558 (patch)
tree4c5aa96b73c1a826eb7d4b7d9ae2325e45b9d7b3 /sound/soc/generic/simple-card-utils.c
parent6475b8e1821c9d14e60592a74c10d75431500c7c (diff)
ASoC: audio-graph-card2: Introduce playback-only/capture-only DAI link flags
We need this to support MICFIL PDM found on i.MX8MP where the DAI link supports only capture direction. Signed-off-by: Daniel Baluta <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'sound/soc/generic/simple-card-utils.c')
-rw-r--r--sound/soc/generic/simple-card-utils.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index cfa70a56ff0f..9006ef5e95f5 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -1129,6 +1129,25 @@ parse_dai_end:
}
EXPORT_SYMBOL_GPL(graph_util_parse_dai);
+int graph_util_parse_link_direction(struct device_node *np,
+ bool *playback_only, bool *capture_only)
+{
+ bool is_playback_only = false;
+ bool is_capture_only = false;
+
+ is_playback_only = of_property_read_bool(np, "playback-only");
+ is_capture_only = of_property_read_bool(np, "capture-only");
+
+ if (is_playback_only && is_capture_only)
+ return -EINVAL;
+
+ *playback_only = is_playback_only;
+ *capture_only = is_capture_only;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);
+
/* Module information */
MODULE_AUTHOR("Kuninori Morimoto <[email protected]>");
MODULE_DESCRIPTION("ALSA SoC Simple Card Utils");