aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2012-04-25 07:12:53 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-26 12:48:19 -0400
commit47c88ffff73d27425be59b34a6d5a91518b5ebed (patch)
tree811a0b42807f3d061a2fa682f1e25e4210407fa1 /sound/soc
parent618dae11f809aaccd05710aa8cee8c46a9cef1a7 (diff)
ASoC: dpcm: Add API for DAI link substream and runtime lookup
Some component drivers will need to be able to look up their DAI link substream and RTD data. Provide a mechanism for this. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 201a4d003b9a..4d8869852ad6 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -465,6 +465,35 @@ static inline void soc_cleanup_card_debugfs(struct snd_soc_card *card)
465} 465}
466#endif 466#endif
467 467
468struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
469 const char *dai_link, int stream)
470{
471 int i;
472
473 for (i = 0; i < card->num_links; i++) {
474 if (card->rtd[i].dai_link->no_pcm &&
475 !strcmp(card->rtd[i].dai_link->name, dai_link))
476 return card->rtd[i].pcm->streams[stream].substream;
477 }
478 dev_dbg(card->dev, "failed to find dai link %s\n", dai_link);
479 return NULL;
480}
481EXPORT_SYMBOL_GPL(snd_soc_get_dai_substream);
482
483struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
484 const char *dai_link)
485{
486 int i;
487
488 for (i = 0; i < card->num_links; i++) {
489 if (!strcmp(card->rtd[i].dai_link->name, dai_link))
490 return &card->rtd[i];
491 }
492 dev_dbg(card->dev, "failed to find rtd %s\n", dai_link);
493 return NULL;
494}
495EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime);
496
468#ifdef CONFIG_SND_SOC_AC97_BUS 497#ifdef CONFIG_SND_SOC_AC97_BUS
469/* unregister ac97 codec */ 498/* unregister ac97 codec */
470static int soc_ac97_dev_unregister(struct snd_soc_codec *codec) 499static int soc_ac97_dev_unregister(struct snd_soc_codec *codec)