summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2026-08-31 06:38:19 +0000
committerMark Brown <broonie@kernel.org>2026-09-09 16:42:30 +0100
commiteee9ed47dfa5dbf5667c08d30c037edf6ac107a3 (patch)
tree984c28d29ba3b5608340658ce75db103e29953a5
parente913f9b77f391762574a72a81e4b4e5b439b942d (diff)
downloadlinux-next-eee9ed47dfa5dbf5667c08d30c037edf6ac107a3.tar.gz
linux-next-eee9ed47dfa5dbf5667c08d30c037edf6ac107a3.zip
ASoC: soc-dai: move snd_soc_is_match_dai_args()
snd_soc_is_match_dai_args() is DAI related function. And its parameter will be capsuled soon, will be not enable to access from soc-core.c. Move it to soc-dai.c It renames function name - snd_soc_is_match_dai_args() + snd_soc_dai_matches_args() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87wlt6sskk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc-dai.h2
-rw-r--r--sound/soc/soc-core.c20
-rw-r--r--sound/soc/soc-dai.c18
3 files changed, 22 insertions, 18 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 6cbec0994a31..e2d995bb1c78 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -278,6 +278,8 @@ int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream,
struct snd_compr_metadata *metadata);
+int snd_soc_dai_matches_args(const struct snd_soc_dai *dai,
+ const struct of_phandle_args *args2);
const char *snd_soc_dai_name(const struct snd_soc_dai *dai);
struct snd_soc_dai_ops {
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4d0496833b2b..9d67db679336 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -233,22 +233,6 @@ static inline void snd_soc_debugfs_exit(void) { }
#endif
-static int snd_soc_is_match_dai_args(const struct of_phandle_args *args1,
- const struct of_phandle_args *args2)
-{
- if (!args1 || !args2)
- return 0;
-
- if (args1->np != args2->np)
- return 0;
-
- for (int i = 0; i < args1->args_count; i++)
- if (args1->args[i] != args2->args[i])
- return 0;
-
- return 1;
-}
-
static inline int snd_soc_dlc_component_is_empty(struct snd_soc_dai_link_component *dlc)
{
return !(dlc->dai_args || dlc->name || dlc->of_node);
@@ -271,7 +255,7 @@ static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc,
return 0;
if (dlc->dai_args)
- return snd_soc_is_match_dai_args(dai->driver->dai_args, dlc->dai_args);
+ return snd_soc_dai_matches_args(dai, dlc->dai_args);
if (!dlc->dai_name)
return 1;
@@ -3516,7 +3500,7 @@ struct snd_soc_dai *snd_soc_get_dai_via_args(const struct of_phandle_args *dai_a
for_each_component(component) {
for_each_component_dais(component, dai)
- if (snd_soc_is_match_dai_args(dai->driver->dai_args, dai_args))
+ if (snd_soc_dai_matches_args(dai, dai_args))
return dai;
}
return NULL;
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 6620abee5e81..ac815aa212d3 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -1010,6 +1010,24 @@ int snd_soc_dai_add_controls(struct snd_soc_dai *dai,
}
EXPORT_SYMBOL_GPL(snd_soc_dai_add_controls);
+int snd_soc_dai_matches_args(const struct snd_soc_dai *dai,
+ const struct of_phandle_args *args2)
+{
+ const struct of_phandle_args *args1 = dai->driver->dai_args;
+
+ if (!args1 || !args2)
+ return 0;
+
+ if (args1->np != args2->np)
+ return 0;
+
+ for (int i = 0; i < args1->args_count; i++)
+ if (args1->args[i] != args2->args[i])
+ return 0;
+
+ return 1;
+}
+
const char *snd_soc_dai_name(const struct snd_soc_dai *dai)
{
/* see snd_soc_is_matching_dai() */