*参照元 [#g245d1f4]
#backlinks

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

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


**引数 [#nddf600f]
-struct snd_soc_card *card
--
--[[linux-4.4.1/snd_soc_card]]
-struct snd_soc_component *component
--
--[[linux-4.4.1/snd_soc_component]]


**返り値 [#p05cea50]
-int
--


**参考 [#o1851b13]


*実装 [#j29db930]
 static int soc_probe_component(struct snd_soc_card *card,
         struct snd_soc_component *component)
 {
         struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
         struct snd_soc_dai *dai;
         int ret;
 
-
--[[linux-4.4.1/snd_soc_dapm_context]]
--[[linux-4.4.1/snd_soc_component_get_dapm()]]
--[[linux-4.4.1/snd_soc_dai]]

         if (!strcmp(component->name, "snd-soc-dummy"))
                 return 0;
 
-
--[[linux-4.4.1/strcmp()]]

         if (component->card) {
                 if (component->card != card) {
                         dev_err(component->dev,
                                 "Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
                                 card->name, component->card->name);
                         return -ENODEV;
                 }
                 return 0;
         }
 
-
--[[linux-4.4.1/dev_err()]]

         if (!try_module_get(component->dev->driver->owner))
                 return -ENODEV;
 
-
--[[linux-4.4.1/try_module_get()]]

         component->card = card;
         dapm->card = card;
         soc_set_name_prefix(card, component);
 
         soc_init_component_debugfs(component);
 
-
--[[linux-4.4.1/soc_set_name_prefix()]]
--[[linux-4.4.1/soc_init_component_debugfs()]]

         if (component->dapm_widgets) {
                 ret = snd_soc_dapm_new_controls(dapm, component->dapm_widgets,
                         component->num_dapm_widgets);
 
-
--[[linux-4.4.1/snd_soc_dapm_new_controls()]]

                 if (ret != 0) {
                         dev_err(component->dev,
                                 "Failed to create new controls %d\n", ret);
                         goto err_probe;
                 }
         }
 
         list_for_each_entry(dai, &component->dai_list, list) {
                 ret = snd_soc_dapm_new_dai_widgets(dapm, dai);
                 if (ret != 0) {
                         dev_err(component->dev,
                                 "Failed to create DAI widgets %d\n", ret);
                         goto err_probe;
                 }
         }
 
-
--[[linux-4.4.1/list_for_each_entry()]]
--[[linux-4.4.1/snd_soc_dapm_new_dai_widgets()]]

         if (component->probe) {
                 ret = component->probe(component);
                 if (ret < 0) {
                         dev_err(component->dev,
                                 "ASoC: failed to probe component %d\n", ret);
                         goto err_probe;
                 }
 
                 WARN(dapm->idle_bias_off &&
                         dapm->bias_level != SND_SOC_BIAS_OFF,
                         "codec %s can not start from non-off bias with idle_bias_off==1\n",
                         component->name);
         }
 
-
--[[linux-4.4.1/WARN()]]

         if (component->controls)
                 snd_soc_add_component_controls(component, component->controls,
                                      component->num_controls);
-
--[[linux-4.4.1/snd_soc_add_component_controls()]]

         if (component->dapm_routes)
                 snd_soc_dapm_add_routes(dapm, component->dapm_routes,
                                         component->num_dapm_routes);
 
-
--[[linux-4.4.1/snd_soc_dapm_add_routes()]]

         list_add(&dapm->list, &card->dapm_list);
 
-
--[[linux-4.4.1/list_add()]]

         /* This is a HACK and will be removed soon */
         if (component->codec)
                 list_add(&component->codec->card_list, &card->codec_dev_list);
 
         return 0;
 
 err_probe:
         soc_cleanup_component_debugfs(component);
         component->card = NULL;
         module_put(component->dev->driver->owner);
 
-
--[[linux-4.4.1/soc_cleanup_component_debugfs()]]
--[[linux-4.4.1/module_put()]]

         return ret;
 }


*コメント [#u5143770]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS