linux-4.4.1/snd_soc_of_parse_audio_simple_widgets()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#a0eea70a]
#backlinks
*説明 [#p679e1c4]
-パス: [[linux-4.4.1/sound/soc/soc-core.c]]
-FIXME: これは何?
--説明
**引数 [#f40a0694]
-struct snd_soc_card *card
--
--[[linux-4.4.1/snd_soc_card]]
-const char *propname
--
**返り値 [#cdaf769a]
-int
--
**参考 [#tde2233a]
*実装 [#x2527f7c]
int snd_soc_of_parse_audio_simple_widgets(struct snd_soc...
const char *pr...
{
struct device_node *np = card->dev->of_node;
struct snd_soc_dapm_widget *widgets;
const char *template, *wname;
int i, j, num_widgets, ret;
-
--[[linux-4.4.1/device_node]]
--[[linux-4.4.1/snd_soc_dapm_widget]]
num_widgets = of_property_count_strings(np, prop...
if (num_widgets < 0) {
dev_err(card->dev,
"ASoC: Property '%s' does not ex...
return -EINVAL;
}
if (num_widgets & 1) {
dev_err(card->dev,
"ASoC: Property '%s' length is n...
return -EINVAL;
}
-
--[[linux-4.4.1/of_property_count_strings()]]
num_widgets /= 2;
if (!num_widgets) {
dev_err(card->dev, "ASoC: Property '%s's...
propname);
return -EINVAL;
}
-
--[[linux-4.4.1/dev_err()]]
widgets = devm_kcalloc(card->dev, num_widgets, s...
GFP_KERNEL);
if (!widgets) {
dev_err(card->dev,
"ASoC: Could not allocate memory...
return -ENOMEM;
}
-
--[[linux-4.4.1/devm_kcalloc()]]
for (i = 0; i < num_widgets; i++) {
ret = of_property_read_string_index(np, ...
2 * i, &template);
if (ret) {
dev_err(card->dev,
"ASoC: Property '%s' ind...
propname, 2 * i, ret);
return -EINVAL;
}
-
--[[linux-4.4.1/of_property_read_string_index()]]
for (j = 0; j < ARRAY_SIZE(simple_widget...
if (!strncmp(template, simple_wi...
strlen(simple_widge...
widgets[i] = simple_widg...
break;
}
}
-
--[[linux-4.4.1/simple_widgets(global)]]
--[[linux-4.4.1/ARRAY_SIZE()]]
--[[linux-4.4.1/strncmp()]]
--[[linux-4.4.1/strlen()]]
if (j >= ARRAY_SIZE(simple_widgets)) {
dev_err(card->dev,
"ASoC: DAPM widget '%s' ...
template);
return -EINVAL;
}
ret = of_property_read_string_index(np, ...
(2 *...
&wna...
if (ret) {
dev_err(card->dev,
"ASoC: Property '%s' ind...
propname, (2 * i) + 1, r...
return -EINVAL;
}
widgets[i].name = wname;
}
card->of_dapm_widgets = widgets;
card->num_of_dapm_widgets = num_widgets;
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#u613a2e3]
終了行:
*参照元 [#a0eea70a]
#backlinks
*説明 [#p679e1c4]
-パス: [[linux-4.4.1/sound/soc/soc-core.c]]
-FIXME: これは何?
--説明
**引数 [#f40a0694]
-struct snd_soc_card *card
--
--[[linux-4.4.1/snd_soc_card]]
-const char *propname
--
**返り値 [#cdaf769a]
-int
--
**参考 [#tde2233a]
*実装 [#x2527f7c]
int snd_soc_of_parse_audio_simple_widgets(struct snd_soc...
const char *pr...
{
struct device_node *np = card->dev->of_node;
struct snd_soc_dapm_widget *widgets;
const char *template, *wname;
int i, j, num_widgets, ret;
-
--[[linux-4.4.1/device_node]]
--[[linux-4.4.1/snd_soc_dapm_widget]]
num_widgets = of_property_count_strings(np, prop...
if (num_widgets < 0) {
dev_err(card->dev,
"ASoC: Property '%s' does not ex...
return -EINVAL;
}
if (num_widgets & 1) {
dev_err(card->dev,
"ASoC: Property '%s' length is n...
return -EINVAL;
}
-
--[[linux-4.4.1/of_property_count_strings()]]
num_widgets /= 2;
if (!num_widgets) {
dev_err(card->dev, "ASoC: Property '%s's...
propname);
return -EINVAL;
}
-
--[[linux-4.4.1/dev_err()]]
widgets = devm_kcalloc(card->dev, num_widgets, s...
GFP_KERNEL);
if (!widgets) {
dev_err(card->dev,
"ASoC: Could not allocate memory...
return -ENOMEM;
}
-
--[[linux-4.4.1/devm_kcalloc()]]
for (i = 0; i < num_widgets; i++) {
ret = of_property_read_string_index(np, ...
2 * i, &template);
if (ret) {
dev_err(card->dev,
"ASoC: Property '%s' ind...
propname, 2 * i, ret);
return -EINVAL;
}
-
--[[linux-4.4.1/of_property_read_string_index()]]
for (j = 0; j < ARRAY_SIZE(simple_widget...
if (!strncmp(template, simple_wi...
strlen(simple_widge...
widgets[i] = simple_widg...
break;
}
}
-
--[[linux-4.4.1/simple_widgets(global)]]
--[[linux-4.4.1/ARRAY_SIZE()]]
--[[linux-4.4.1/strncmp()]]
--[[linux-4.4.1/strlen()]]
if (j >= ARRAY_SIZE(simple_widgets)) {
dev_err(card->dev,
"ASoC: DAPM widget '%s' ...
template);
return -EINVAL;
}
ret = of_property_read_string_index(np, ...
(2 *...
&wna...
if (ret) {
dev_err(card->dev,
"ASoC: Property '%s' ind...
propname, (2 * i) + 1, r...
return -EINVAL;
}
widgets[i].name = wname;
}
card->of_dapm_widgets = widgets;
card->num_of_dapm_widgets = num_widgets;
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#u613a2e3]
ページ名: