Commit 8696d732 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: simple-audio-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 Simple Audio
Card still not yet support it. Let's support it.

Cc: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plsmzojk.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5d9cacdc
......@@ -176,6 +176,8 @@ static int simple_link_init(struct simple_util_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
struct device_node *node = of_get_parent(cpu);
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;
......@@ -198,9 +200,17 @@ static int simple_link_init(struct simple_util_priv *priv,
of_property_read_u32(codec, "mclk-fs", &dai_props->mclk_fs);
of_property_read_u32(codec, PREFIX "mclk-fs", &dai_props->mclk_fs);
graph_util_parse_trigger_order(priv, top, &trigger_start, &trigger_stop);
graph_util_parse_trigger_order(priv, node, &trigger_start, &trigger_stop);
graph_util_parse_trigger_order(priv, cpu, &trigger_start, &trigger_stop);
graph_util_parse_trigger_order(priv, 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 = &simple_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment