summaryrefslogtreecommitdiffstats
path: root/sound/soc/generic/audio-graph-card.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2024-06-12 08:02:46 +0200
committerMark Brown <broonie@kernel.org>2024-06-26 18:47:58 +0200
commit4d4125d8f5e19476c006014d5530b8127ed5703f (patch)
treed9be18483001c964b6cf6c76194dc6df0ddf290a /sound/soc/generic/audio-graph-card.c
parentASoC: simple-audio-card: add link-trigger-order support (diff)
downloadlinux-4d4125d8f5e19476c006014d5530b8127ed5703f.tar.xz
linux-4d4125d8f5e19476c006014d5530b8127ed5703f.zip
ASoC: audio-graph-card: add link-trigger-order support
Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Audio Graph Card still not yet support it. Let's support it. Cc: Maxim Kochetkov <fido_max@inbox.ru> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87o786zojd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r--sound/soc/generic/audio-graph-card.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 7b981aa8690a..acf7d92d21e6 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -143,6 +143,8 @@ static int graph_link_init(struct simple_util_priv *priv,
struct device_node *port_codec = ep_to_port(ep_codec);
struct device_node *ports_cpu = port_to_ports(port_cpu);
struct device_node *ports_codec = port_to_ports(port_codec);
+ enum snd_soc_trigger_order trigger_start = SND_SOC_TRIGGER_ORDER_DEFAULT;
+ enum snd_soc_trigger_order trigger_stop = SND_SOC_TRIGGER_ORDER_DEFAULT;
bool playback_only = 0, capture_only = 0;
int ret;
@@ -165,9 +167,20 @@ static int graph_link_init(struct simple_util_priv *priv,
of_property_read_u32(ep_cpu, "mclk-fs", &dai_props->mclk_fs);
of_property_read_u32(ep_codec, "mclk-fs", &dai_props->mclk_fs);
+ graph_util_parse_trigger_order(priv, top, &trigger_start, &trigger_stop);
+ graph_util_parse_trigger_order(priv, ports_cpu, &trigger_start, &trigger_stop);
+ graph_util_parse_trigger_order(priv, ports_codec, &trigger_start, &trigger_stop);
+ graph_util_parse_trigger_order(priv, port_cpu, &trigger_start, &trigger_stop);
+ graph_util_parse_trigger_order(priv, port_cpu, &trigger_start, &trigger_stop);
+ graph_util_parse_trigger_order(priv, ep_cpu, &trigger_start, &trigger_stop);
+ graph_util_parse_trigger_order(priv, ep_codec, &trigger_start, &trigger_stop);
+
dai_link->playback_only = playback_only;
dai_link->capture_only = capture_only;
+ dai_link->trigger_start = trigger_start;
+ dai_link->trigger_stop = trigger_stop;
+
dai_link->init = simple_util_dai_init;
dai_link->ops = &graph_ops;
if (priv->ops)