diff options
-rw-r--r-- | include/sound/soc.h | 2 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 24b484b..0271b61 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -337,6 +337,8 @@ unsigned int snd_soc_platform_read(struct snd_soc_platform *platform, unsigned int snd_soc_platform_write(struct snd_soc_platform *platform, unsigned int reg, unsigned int val); +struct snd_soc_codec *snd_soc_card_get_codec(struct snd_soc_card *card, + const char *codec_name); struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, const char *dai_link, int stream); struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6d3b203..674e588 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1117,6 +1117,20 @@ static int soc_pcm_ioctl(struct snd_pcm_substream *substream, return snd_pcm_lib_ioctl(substream, cmd, arg); } +struct snd_soc_codec *snd_soc_card_get_codec(struct snd_soc_card *card, + const char *codec_name) +{ + struct snd_soc_codec *codec = NULL; + + list_for_each_entry(codec, &card->codec_dev_list, card_list) { + if (!strcmp(codec->name, codec_name)) + return codec; + } + + return codec; +} +EXPORT_SYMBOL(snd_soc_card_get_codec); + struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, const char *dai_link, int stream) { |