summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2024-05-28 05:05:32 +0000
committerMark Brown <broonie@kernel.org>2024-06-03 15:59:37 +0100
commitf2d7e85962baf410b1bbbb4cf23a1ca59261ef76 (patch)
tree88ed5ab90d303a2b434c1e3c440fc191ce0bf3c0
parent844de7eebe97a1c277f8a408457712086c957195 (diff)
ASoC: audio-graph-card2: merge graph_parse_mclk_fs() into graph_link_init()
Now graph_link_init() is parsing dai_link related property. Let's handle mclk_fs on it, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/874jaih6g3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/generic/audio-graph-card2.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index bd714a6f74e6..8eea81888758 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -389,20 +389,6 @@ static void graph_parse_convert(struct device_node *ep,
of_node_put(ports);
}
-static void graph_parse_mclk_fs(struct device_node *ep,
- struct simple_dai_props *props)
-{
- struct device_node *port = ep_to_port(ep);
- struct device_node *ports = port_to_ports(port);
-
- of_property_read_u32(ports, "mclk-fs", &props->mclk_fs);
- of_property_read_u32(port, "mclk-fs", &props->mclk_fs);
- of_property_read_u32(ep, "mclk-fs", &props->mclk_fs);
-
- of_node_put(port);
- of_node_put(ports);
-}
-
static int __graph_parse_node(struct simple_util_priv *priv,
enum graph_type gtype,
struct device_node *ep,
@@ -424,8 +410,6 @@ static int __graph_parse_node(struct simple_util_priv *priv,
dai = simple_props_to_dai_codec(dai_props, idx);
}
- graph_parse_mclk_fs(ep, dai_props);
-
ret = graph_util_parse_dai(dev, ep, dlc, &is_single_links);
if (ret < 0)
return ret;
@@ -770,6 +754,7 @@ static void graph_link_init(struct simple_util_priv *priv,
int is_cpu_node)
{
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 *ep_cpu, *ep_codec;
struct device_node *ports_cpu, *ports_codec;
unsigned int daifmt = 0, daiclk = 0;
@@ -813,6 +798,14 @@ static void graph_link_init(struct simple_util_priv *priv,
graph_util_parse_link_direction(ep_cpu, &playback_only, &capture_only);
graph_util_parse_link_direction(ep_codec, &playback_only, &capture_only);
+ of_property_read_u32(lnk, "mclk-fs", &dai_props->mclk_fs);
+ of_property_read_u32(ports_cpu, "mclk-fs", &dai_props->mclk_fs);
+ of_property_read_u32(ports_codec, "mclk-fs", &dai_props->mclk_fs);
+ of_property_read_u32(port_cpu, "mclk-fs", &dai_props->mclk_fs);
+ of_property_read_u32(port_codec, "mclk-fs", &dai_props->mclk_fs);
+ of_property_read_u32(ep_cpu, "mclk-fs", &dai_props->mclk_fs);
+ of_property_read_u32(ep_codec, "mclk-fs", &dai_props->mclk_fs);
+
/*
* convert bit_frame
* We need to flip clock_provider if it was CPU node,