aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-08 14:26:48 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-09 08:30:05 -0500
commit6b05eda6383d89bffc21da654d148733e7839540 (patch)
tree68c408c35d0ae0d8e065e188ede4f11b73138656
parent435c5e2588893e3f7aba0bd4de67991bf00b3c9d (diff)
ASoC: Wait for non-AC97 codec DAIs before instantiating
This will allow codec drivers to be refactored to allow them to be registered out of line with the ASoC device registration. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/soc-core.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 717db0e6499b..76a89eb65baf 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -788,7 +788,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
788 struct snd_soc_codec_device *codec_dev = card->socdev->codec_dev; 788 struct snd_soc_codec_device *codec_dev = card->socdev->codec_dev;
789 struct snd_soc_platform *platform; 789 struct snd_soc_platform *platform;
790 struct snd_soc_dai *dai; 790 struct snd_soc_dai *dai;
791 int i, found, ret; 791 int i, found, ret, ac97;
792 792
793 if (card->instantiated) 793 if (card->instantiated)
794 return; 794 return;
@@ -805,6 +805,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
805 return; 805 return;
806 } 806 }
807 807
808 ac97 = 0;
808 for (i = 0; i < card->num_links; i++) { 809 for (i = 0; i < card->num_links; i++) {
809 found = 0; 810 found = 0;
810 list_for_each_entry(dai, &dai_list, list) 811 list_for_each_entry(dai, &dai_list, list)
@@ -817,8 +818,32 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
817 card->dai_link[i].cpu_dai->name); 818 card->dai_link[i].cpu_dai->name);
818 return; 819 return;
819 } 820 }
821
822 if (card->dai_link[i].cpu_dai->ac97_control)
823 ac97 = 1;
820 } 824 }
821 825
826 /* If we have AC97 in the system then don't wait for the
827 * codec. This will need revisiting if we have to handle
828 * systems with mixed AC97 and non-AC97 parts. Only check for
829 * DAIs currently; we can't do this per link since some AC97
830 * codecs have non-AC97 DAIs.
831 */
832 if (!ac97)
833 for (i = 0; i < card->num_links; i++) {
834 found = 0;
835 list_for_each_entry(dai, &dai_list, list)
836 if (card->dai_link[i].codec_dai == dai) {
837 found = 1;
838 break;
839 }
840 if (!found) {
841 dev_dbg(card->dev, "DAI %s not registered\n",
842 card->dai_link[i].codec_dai->name);
843 return;
844 }
845 }
846
822 /* Note that we do not current check for codec components */ 847 /* Note that we do not current check for codec components */
823 848
824 dev_dbg(card->dev, "All components present, instantiating\n"); 849 dev_dbg(card->dev, "All components present, instantiating\n");