From 3e021f3b8115614127dd04c5615ccbcc2706bdd5 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 16 Apr 2025 06:27:10 +0000 Subject: [PATCH] ASoC: soc-utils: add snd_soc_dlc_is_dummy() We have snd_soc_xxx_is_dummy() functions, but not for dlc. Let's add it. Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87cydc8vup.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc.h | 2 +- sound/soc/soc-utils.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 952ed77b8c87..21903984af49 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -935,7 +935,7 @@ snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) { extern struct snd_soc_dai_link_component null_dailink_component[0]; extern struct snd_soc_dai_link_component snd_soc_dummy_dlc; - +int snd_soc_dlc_is_dummy(struct snd_soc_dai_link_component *dlc); struct snd_soc_codec_conf { /* diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index 5e3e4f14c392..a1bcc852a6de 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c @@ -262,6 +262,19 @@ struct snd_soc_dai_link_component snd_soc_dummy_dlc = { }; EXPORT_SYMBOL_GPL(snd_soc_dummy_dlc); +int snd_soc_dlc_is_dummy(struct snd_soc_dai_link_component *dlc) +{ + if (dlc == &snd_soc_dummy_dlc) + return true; + + if (strcmp(dlc->name, snd_soc_dummy_dlc.name) == 0 || + strcmp(dlc->dai_name, snd_soc_dummy_dlc.dai_name) == 0) + return true; + + return false; +} +EXPORT_SYMBOL_GPL(snd_soc_dlc_is_dummy); + static int snd_soc_dummy_probe(struct faux_device *fdev) { int ret; -- 2.25.1