diff options
-rw-r--r-- | sound/soc/soc-core.c | 27 |
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"); |