summaryrefslogtreecommitdiff
path: root/sound/soc/soc-card.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-05-28 10:47:56 +0900
committerMark Brown <broonie@kernel.org>2020-05-30 02:11:27 +0100
commit209c6cdfd28360f030f88ae9adb69f633e6bcd2d (patch)
tree8ab3819b76172209ea14ee64d58c915ddcb1233d /sound/soc/soc-card.c
parent1793936bc9081d541da2ecd2af83eded7e6212a7 (diff)
downloadlwn-209c6cdfd28360f030f88ae9adb69f633e6bcd2d.tar.gz
lwn-209c6cdfd28360f030f88ae9adb69f633e6bcd2d.zip
ASoC: soc-card: move snd_soc_card_get_kcontrol() to soc-card
Card related function should be implemented at soc-card now. This patch moves it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87a71s25kj.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-card.c')
-rw-r--r--sound/soc/soc-card.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
index 4bc6f26ea8cb..340ab682cc76 100644
--- a/sound/soc/soc-card.c
+++ b/sound/soc/soc-card.c
@@ -24,3 +24,19 @@ static inline int _soc_card_ret(struct snd_soc_card *card,
return ret;
}
+
+struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
+ const char *name)
+{
+ struct snd_card *card = soc_card->snd_card;
+ struct snd_kcontrol *kctl;
+
+ if (unlikely(!name))
+ return NULL;
+
+ list_for_each_entry(kctl, &card->controls, list)
+ if (!strncmp(kctl->id.name, name, sizeof(kctl->id.name)))
+ return kctl;
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(snd_soc_card_get_kcontrol);