summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-22 14:28:25 +0100
committerMark Brown <broonie@linaro.org>2013-08-22 14:28:25 +0100
commit6234eabf84d6dcb2e28d4fdae43029c04c1bbc46 (patch)
tree3d451ebd41c9cabb206fd3033f135e943de04da6 /sound/soc/soc-core.c
parentece59528fa0318825a23a7c297b2fe8cddfca0a2 (diff)
parent92bb4c32708ee3e1d6eb0e185d678dab35152daf (diff)
downloadlinux-6234eabf84d6dcb2e28d4fdae43029c04c1bbc46.tar.bz2
Merge remote-tracking branch 'asoc/topic/adsp' into asoc-next
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b5c91f9aa160..046f8778f2b8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2452,6 +2452,22 @@ static int snd_soc_add_controls(struct snd_card *card, struct device *dev,
return 0;
}
+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);
+
/**
* snd_soc_add_codec_controls - add an array of controls to a codec.
* Convenience function to add a list of controls. Many codecs were