linux-4.4.1/snd_soc_instantiate_card()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#ia02807e]
#backlinks
*説明 [#m4600dce]
-パス: [[linux-4.4.1/sound/soc/soc-core.c]]
-FIXME: これは何?
--説明
**引数 [#d58500b7]
-struct snd_soc_card *card
--
--[[linux-4.4.1/snd_soc_card]]
**返り値 [#j40d3c83]
-int
--
**参考 [#n6a8c425]
*実装 [#o5cd362c]
static int snd_soc_instantiate_card(struct snd_soc_card ...
{
struct snd_soc_codec *codec;
int ret, i, order;
-
--[[linux-4.4.1/snd_soc_codec]]
mutex_lock(&client_mutex);
mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLA...
-
--[[linux-4.4.1/mutex_lock()]]
--[[linux-4.4.1/client_mutex(global)]]
--[[linux-4.4.1/mutex_lock_nested()]]
/* bind DAIs */
for (i = 0; i < card->num_links; i++) {
ret = soc_bind_dai_link(card, i);
if (ret != 0)
goto base_error;
}
-
--[[linux-4.4.1/soc_bind_dai_link()]]
/* bind aux_devs too */
for (i = 0; i < card->num_aux_devs; i++) {
ret = soc_bind_aux_dev(card, i);
if (ret != 0)
goto base_error;
}
-
--[[linux-4.4.1/soc_bind_aux_dev()]]
/* initialize the register cache for each availa...
list_for_each_entry(codec, &codec_list, list) {
if (codec->cache_init)
continue;
ret = snd_soc_init_codec_cache(codec);
if (ret < 0)
goto base_error;
}
-
--[[linux-4.4.1/list_for_each_entry()]]
--[[linux-4.4.1/snd_soc_init_codec_cache()]]
--[[linux-4.4.1/codec_list(global)]]
/* card bind complete so register a sound card */
ret = snd_card_new(card->dev, SNDRV_DEFAULT_IDX1...
card->owner, 0, &card->snd_card);
if (ret < 0) {
dev_err(card->dev,
"ASoC: can't create sound card f...
card->name, ret);
goto base_error;
}
-
--[[linux-4.4.1/snd_card_new()]]
--[[linux-4.4.1/dev_err()]]
soc_init_card_debugfs(card);
-
--[[linux-4.4.1/soc_init_card_debugfs()]]
card->dapm.bias_level = SND_SOC_BIAS_OFF;
card->dapm.dev = card->dev;
card->dapm.card = card;
list_add(&card->dapm.list, &card->dapm_list);
-
--[[linux-4.4.1/list_add()]]
#ifdef CONFIG_DEBUG_FS
snd_soc_dapm_debugfs_init(&card->dapm, card->deb...
-
--[[linux-4.4.1/CONFIG_DEBUG_FS]]
--[[linux-4.4.1/snd_soc_dapm_debugfs_init()]]
#endif
#ifdef CONFIG_PM_SLEEP
/* deferred resume work */
INIT_WORK(&card->deferred_resume_work, soc_resum...
-
--[[linux-4.4.1/CONFIG_PM_SLEEP]]
--[[linux-4.4.1/INIT_WORK()]]
--[[linux-4.4.1/soc_resume_deferred()]]
#endif
if (card->dapm_widgets)
snd_soc_dapm_new_controls(&card->dapm, c...
card->num_dapm...
if (card->of_dapm_widgets)
snd_soc_dapm_new_controls(&card->dapm, c...
card->num_of_d...
-
--[[linux-4.4.1/snd_soc_dapm_new_controls()]]
/* initialise the sound card only once */
if (card->probe) {
ret = card->probe(card);
if (ret < 0)
goto card_probe_error;
}
/* probe all components used by DAI links on thi...
for (order = SND_SOC_COMP_ORDER_FIRST; order <= ...
order++) {
for (i = 0; i < card->num_links; i++) {
ret = soc_probe_link_components(...
if (ret < 0) {
dev_err(card->dev,
"ASoC: failed to...
ret);
goto probe_dai_err;
}
-
--[[linux-4.4.1/soc_probe_link_components()]]
}
}
/* probe all DAI links on this card */
for (order = SND_SOC_COMP_ORDER_FIRST; order <= ...
order++) {
for (i = 0; i < card->num_links; i++) {
ret = soc_probe_link_dais(card, ...
if (ret < 0) {
dev_err(card->dev,
"ASoC: failed to...
ret);
goto probe_dai_err;
}
-
--[[linux-4.4.1/soc_probe_link_dais()]]
}
}
for (i = 0; i < card->num_aux_devs; i++) {
ret = soc_probe_aux_dev(card, i);
if (ret < 0) {
dev_err(card->dev,
"ASoC: failed to add aux...
ret);
goto probe_aux_dev_err;
}
-
--[[linux-4.4.1/soc_probe_aux_dev()]]
}
snd_soc_dapm_link_dai_widgets(card);
snd_soc_dapm_connect_dai_link_widgets(card);
-
--[[linux-4.4.1/snd_soc_dapm_link_dai_widgets()]]
--[[linux-4.4.1/snd_soc_dapm_connect_dai_link_widgets()]]
if (card->controls)
snd_soc_add_card_controls(card, card->co...
-
--[[linux-4.4.1/snd_soc_add_card_controls()]]
if (card->dapm_routes)
snd_soc_dapm_add_routes(&card->dapm, car...
card->num_dapm_r...
if (card->of_dapm_routes)
snd_soc_dapm_add_routes(&card->dapm, car...
card->num_of_dap...
-
--[[linux-4.4.1/snd_soc_dapm_add_routes()]]
snprintf(card->snd_card->shortname, sizeof(card-...
"%s", card->name);
snprintf(card->snd_card->longname, sizeof(card->...
"%s", card->long_name ? card->long_name...
snprintf(card->snd_card->driver, sizeof(card->sn...
"%s", card->driver_name ? card->driver_...
-
--[[linux-4.4.1/snprintf()]]
for (i = 0; i < ARRAY_SIZE(card->snd_card->drive...
switch (card->snd_card->driver[i]) {
case '_':
case '-':
case '\0':
break;
default:
if (!isalnum(card->snd_card->dri...
card->snd_card->driver[i...
break;
}
}
-
--[[linux-4.4.1/ARRAY_SIZE()]]
--[[linux-4.4.1/isalnum()]]
if (card->late_probe) {
ret = card->late_probe(card);
if (ret < 0) {
dev_err(card->dev, "ASoC: %s lat...
card->name, ret);
goto probe_aux_dev_err;
}
}
snd_soc_dapm_new_widgets(card);
-
--[[linux-4.4.1/snd_soc_dapm_new_widgets()]]
ret = snd_card_register(card->snd_card);
if (ret < 0) {
dev_err(card->dev, "ASoC: failed to regi...
ret);
goto probe_aux_dev_err;
}
-
--[[linux-4.4.1/snd_card_register()]]
card->instantiated = 1;
snd_soc_dapm_sync(&card->dapm);
mutex_unlock(&card->mutex);
mutex_unlock(&client_mutex);
-
--[[linux-4.4.1/snd_soc_dapm_sync()]]
--[[linux-4.4.1/mutex_unlock()]]
return 0;
probe_aux_dev_err:
for (i = 0; i < card->num_aux_devs; i++)
soc_remove_aux_dev(card, i);
-
--[[linux-4.4.1/soc_remove_aux_dev()]]
probe_dai_err:
soc_remove_dai_links(card);
-
--[[linux-4.4.1/soc_remove_dai_links()]]
card_probe_error:
if (card->remove)
card->remove(card);
snd_soc_dapm_free(&card->dapm);
soc_cleanup_card_debugfs(card);
snd_card_free(card->snd_card);
-
--[[linux-4.4.1/snd_soc_dapm_free()]]
--[[linux-4.4.1/soc_cleanup_card_debugfs()]]
--[[linux-4.4.1/snd_card_free()]]
base_error:
mutex_unlock(&card->mutex);
mutex_unlock(&client_mutex);
return ret;
}
*コメント [#s8f39818]
終了行:
*参照元 [#ia02807e]
#backlinks
*説明 [#m4600dce]
-パス: [[linux-4.4.1/sound/soc/soc-core.c]]
-FIXME: これは何?
--説明
**引数 [#d58500b7]
-struct snd_soc_card *card
--
--[[linux-4.4.1/snd_soc_card]]
**返り値 [#j40d3c83]
-int
--
**参考 [#n6a8c425]
*実装 [#o5cd362c]
static int snd_soc_instantiate_card(struct snd_soc_card ...
{
struct snd_soc_codec *codec;
int ret, i, order;
-
--[[linux-4.4.1/snd_soc_codec]]
mutex_lock(&client_mutex);
mutex_lock_nested(&card->mutex, SND_SOC_CARD_CLA...
-
--[[linux-4.4.1/mutex_lock()]]
--[[linux-4.4.1/client_mutex(global)]]
--[[linux-4.4.1/mutex_lock_nested()]]
/* bind DAIs */
for (i = 0; i < card->num_links; i++) {
ret = soc_bind_dai_link(card, i);
if (ret != 0)
goto base_error;
}
-
--[[linux-4.4.1/soc_bind_dai_link()]]
/* bind aux_devs too */
for (i = 0; i < card->num_aux_devs; i++) {
ret = soc_bind_aux_dev(card, i);
if (ret != 0)
goto base_error;
}
-
--[[linux-4.4.1/soc_bind_aux_dev()]]
/* initialize the register cache for each availa...
list_for_each_entry(codec, &codec_list, list) {
if (codec->cache_init)
continue;
ret = snd_soc_init_codec_cache(codec);
if (ret < 0)
goto base_error;
}
-
--[[linux-4.4.1/list_for_each_entry()]]
--[[linux-4.4.1/snd_soc_init_codec_cache()]]
--[[linux-4.4.1/codec_list(global)]]
/* card bind complete so register a sound card */
ret = snd_card_new(card->dev, SNDRV_DEFAULT_IDX1...
card->owner, 0, &card->snd_card);
if (ret < 0) {
dev_err(card->dev,
"ASoC: can't create sound card f...
card->name, ret);
goto base_error;
}
-
--[[linux-4.4.1/snd_card_new()]]
--[[linux-4.4.1/dev_err()]]
soc_init_card_debugfs(card);
-
--[[linux-4.4.1/soc_init_card_debugfs()]]
card->dapm.bias_level = SND_SOC_BIAS_OFF;
card->dapm.dev = card->dev;
card->dapm.card = card;
list_add(&card->dapm.list, &card->dapm_list);
-
--[[linux-4.4.1/list_add()]]
#ifdef CONFIG_DEBUG_FS
snd_soc_dapm_debugfs_init(&card->dapm, card->deb...
-
--[[linux-4.4.1/CONFIG_DEBUG_FS]]
--[[linux-4.4.1/snd_soc_dapm_debugfs_init()]]
#endif
#ifdef CONFIG_PM_SLEEP
/* deferred resume work */
INIT_WORK(&card->deferred_resume_work, soc_resum...
-
--[[linux-4.4.1/CONFIG_PM_SLEEP]]
--[[linux-4.4.1/INIT_WORK()]]
--[[linux-4.4.1/soc_resume_deferred()]]
#endif
if (card->dapm_widgets)
snd_soc_dapm_new_controls(&card->dapm, c...
card->num_dapm...
if (card->of_dapm_widgets)
snd_soc_dapm_new_controls(&card->dapm, c...
card->num_of_d...
-
--[[linux-4.4.1/snd_soc_dapm_new_controls()]]
/* initialise the sound card only once */
if (card->probe) {
ret = card->probe(card);
if (ret < 0)
goto card_probe_error;
}
/* probe all components used by DAI links on thi...
for (order = SND_SOC_COMP_ORDER_FIRST; order <= ...
order++) {
for (i = 0; i < card->num_links; i++) {
ret = soc_probe_link_components(...
if (ret < 0) {
dev_err(card->dev,
"ASoC: failed to...
ret);
goto probe_dai_err;
}
-
--[[linux-4.4.1/soc_probe_link_components()]]
}
}
/* probe all DAI links on this card */
for (order = SND_SOC_COMP_ORDER_FIRST; order <= ...
order++) {
for (i = 0; i < card->num_links; i++) {
ret = soc_probe_link_dais(card, ...
if (ret < 0) {
dev_err(card->dev,
"ASoC: failed to...
ret);
goto probe_dai_err;
}
-
--[[linux-4.4.1/soc_probe_link_dais()]]
}
}
for (i = 0; i < card->num_aux_devs; i++) {
ret = soc_probe_aux_dev(card, i);
if (ret < 0) {
dev_err(card->dev,
"ASoC: failed to add aux...
ret);
goto probe_aux_dev_err;
}
-
--[[linux-4.4.1/soc_probe_aux_dev()]]
}
snd_soc_dapm_link_dai_widgets(card);
snd_soc_dapm_connect_dai_link_widgets(card);
-
--[[linux-4.4.1/snd_soc_dapm_link_dai_widgets()]]
--[[linux-4.4.1/snd_soc_dapm_connect_dai_link_widgets()]]
if (card->controls)
snd_soc_add_card_controls(card, card->co...
-
--[[linux-4.4.1/snd_soc_add_card_controls()]]
if (card->dapm_routes)
snd_soc_dapm_add_routes(&card->dapm, car...
card->num_dapm_r...
if (card->of_dapm_routes)
snd_soc_dapm_add_routes(&card->dapm, car...
card->num_of_dap...
-
--[[linux-4.4.1/snd_soc_dapm_add_routes()]]
snprintf(card->snd_card->shortname, sizeof(card-...
"%s", card->name);
snprintf(card->snd_card->longname, sizeof(card->...
"%s", card->long_name ? card->long_name...
snprintf(card->snd_card->driver, sizeof(card->sn...
"%s", card->driver_name ? card->driver_...
-
--[[linux-4.4.1/snprintf()]]
for (i = 0; i < ARRAY_SIZE(card->snd_card->drive...
switch (card->snd_card->driver[i]) {
case '_':
case '-':
case '\0':
break;
default:
if (!isalnum(card->snd_card->dri...
card->snd_card->driver[i...
break;
}
}
-
--[[linux-4.4.1/ARRAY_SIZE()]]
--[[linux-4.4.1/isalnum()]]
if (card->late_probe) {
ret = card->late_probe(card);
if (ret < 0) {
dev_err(card->dev, "ASoC: %s lat...
card->name, ret);
goto probe_aux_dev_err;
}
}
snd_soc_dapm_new_widgets(card);
-
--[[linux-4.4.1/snd_soc_dapm_new_widgets()]]
ret = snd_card_register(card->snd_card);
if (ret < 0) {
dev_err(card->dev, "ASoC: failed to regi...
ret);
goto probe_aux_dev_err;
}
-
--[[linux-4.4.1/snd_card_register()]]
card->instantiated = 1;
snd_soc_dapm_sync(&card->dapm);
mutex_unlock(&card->mutex);
mutex_unlock(&client_mutex);
-
--[[linux-4.4.1/snd_soc_dapm_sync()]]
--[[linux-4.4.1/mutex_unlock()]]
return 0;
probe_aux_dev_err:
for (i = 0; i < card->num_aux_devs; i++)
soc_remove_aux_dev(card, i);
-
--[[linux-4.4.1/soc_remove_aux_dev()]]
probe_dai_err:
soc_remove_dai_links(card);
-
--[[linux-4.4.1/soc_remove_dai_links()]]
card_probe_error:
if (card->remove)
card->remove(card);
snd_soc_dapm_free(&card->dapm);
soc_cleanup_card_debugfs(card);
snd_card_free(card->snd_card);
-
--[[linux-4.4.1/snd_soc_dapm_free()]]
--[[linux-4.4.1/soc_cleanup_card_debugfs()]]
--[[linux-4.4.1/snd_card_free()]]
base_error:
mutex_unlock(&card->mutex);
mutex_unlock(&client_mutex);
return ret;
}
*コメント [#s8f39818]
ページ名: