*参照元 [#o19682d3]
#backlinks

*説明 [#de808bdd]
-パス: [[linux-2.6.33/sound/soc-core.c]]

-FIXME: これは何?
--説明


**引数 [#r3782659]
-struct snd_soc_card *card
--
--[[linux-2.6.33/snd_soc_card]]


**返り値 [#q853654f]
-なし


**参考 [#e15aa83d]


*実装 [#u7de6097]
 static void snd_soc_instantiate_card(struct snd_soc_card *card)
 {
 	struct platform_device *pdev = container_of(card->dev,
 						    struct platform_device,
 						    dev);
 	struct snd_soc_codec_device *codec_dev = card->socdev->codec_dev;
 	struct snd_soc_codec *codec;
 	struct snd_soc_platform *platform;
 	struct snd_soc_dai *dai;
 	int i, found, ret, ac97;
 
-
--[[linux-2.6.33/platform_device]]
-
--[[linux-2.6.33/container_of()]]
-
--[[linux-2.6.33/snd_soc_codec_device]]
-
--[[linux-2.6.33/snd_soc_codec]]
-
--[[linux-2.6.33/snd_soc_platform]]
-
--[[linux-2.6.33/snd_soc_dai]]

 	if (card->instantiated)
 		return;
 
 	found = 0;
 	list_for_each_entry(platform, &platform_list, list)
 		if (card->platform == platform) {
 			found = 1;
 			break;
 		}
 	if (!found) {
 		dev_dbg(card->dev, "Platform %s not registered\n",
 			card->platform->name);
 		return;
 	}
 
-
--[[linux-2.6.33/list_for_each_entry()]]
-
--[[linux-2.6.33/dev_dbg()]]

 	ac97 = 0;
 	for (i = 0; i < card->num_links; i++) {
 		found = 0;
 		list_for_each_entry(dai, &dai_list, list)
 			if (card->dai_link[i].cpu_dai == dai) {
 				found = 1;
 				break;
 			}
 		if (!found) {
 			dev_dbg(card->dev, "DAI %s not registered\n",
 				card->dai_link[i].cpu_dai->name);
 			return;
 		}
 
 		if (card->dai_link[i].cpu_dai->ac97_control)
 			ac97 = 1;
 	}
 
 	for (i = 0; i < card->num_links; i++) {
 		if (!card->dai_link[i].codec_dai->ops)
 			card->dai_link[i].codec_dai->ops = &null_dai_ops;
 	}
 
-
--[[linux-2.6.33/null_dai_ops(global)]]

 	/* If we have AC97 in the system then don't wait for the
 	 * codec.  This will need revisiting if we have to handle
 	 * systems with mixed AC97 and non-AC97 parts.  Only check for
 	 * DAIs currently; we can't do this per link since some AC97
 	 * codecs have non-AC97 DAIs.
 	 */
 	if (!ac97)
 		for (i = 0; i < card->num_links; i++) {
 			found = 0;
 			list_for_each_entry(dai, &dai_list, list)
 				if (card->dai_link[i].codec_dai == dai) {
 					found = 1;
 					break;
 				}
 			if (!found) {
 				dev_dbg(card->dev, "DAI %s not registered\n",
 					card->dai_link[i].codec_dai->name);
 				return;
 			}
 		}
 
 	/* Note that we do not current check for codec components */
 
 	dev_dbg(card->dev, "All components present, instantiating\n");
 
 	/* Found everything, bring it up */
 	if (card->probe) {
 		ret = card->probe(pdev);
 		if (ret < 0)
 			return;
 	}
 
 	for (i = 0; i < card->num_links; i++) {
 		struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
 		if (cpu_dai->probe) {
 			ret = cpu_dai->probe(pdev, cpu_dai);
 			if (ret < 0)
 				goto cpu_dai_err;
 		}
 	}
 
 	if (codec_dev->probe) {
 		ret = codec_dev->probe(pdev);
 		if (ret < 0)
 			goto cpu_dai_err;
 	}
 
 	if (platform->probe) {
 		ret = platform->probe(pdev);
 		if (ret < 0)
 			goto platform_err;
 	}
 
 	/* DAPM stream work */
 	INIT_DELAYED_WORK(&card->delayed_work, close_delayed_work);
 #ifdef CONFIG_PM
 	/* deferred resume work */
 	INIT_WORK(&card->deferred_resume_work, soc_resume_deferred);
 #endif
 
-
--[[linux-2.6.33/INIT_DELAYED_WORK()]]
-
--[[linux-2.6.33/close_delayed_work()]]
-
--[[linux-2.6.33/INIT_WORK()]]
-
--[[linux-2.6.33/soc_resume_deferred()]]

 	card->instantiated = 1;
 
 	return;
 
 platform_err:
 	if (codec_dev->remove)
 		codec_dev->remove(pdev);
 
 cpu_dai_err:
 	for (i--; i >= 0; i--) {
 		struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
 		if (cpu_dai->remove)
 			cpu_dai->remove(pdev, cpu_dai);
 	}
 
 	if (card->remove)
 		card->remove(pdev);
 }


*コメント [#fa140b93]

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS