*be_id = soc_end->dai_info->dailink[stream]; if (*be_id < 0) {
dev_err(dev, "Invalid dailink id %d\n", *be_id); return -EINVAL;
}
switch (amd_ctx->acp_rev) { case ACP63_PCI_REV:
ret = get_acp63_cpu_pin_id(ffs(soc_end->link_mask - 1),
*be_id, &cpu_pin_id, dev); if (ret) return ret; break; case ACP70_PCI_REV: case ACP71_PCI_REV: case ACP72_PCI_REV:
ret = get_acp70_cpu_pin_id(ffs(soc_end->link_mask - 1),
*be_id, &cpu_pin_id, dev); if (ret) return ret; break; default: return -EINVAL;
} /* create stream name according to first link id */ if (ctx->append_dai_type) {
name = devm_kasprintf(dev, GFP_KERNEL,
sdw_stream_name[stream + 2],
ffs(soc_end->link_mask) - 1,
cpu_pin_id,
type_strings[soc_end->dai_info->dai_type]);
} else {
name = devm_kasprintf(dev, GFP_KERNEL,
sdw_stream_name[stream],
ffs(soc_end->link_mask) - 1,
cpu_pin_id);
} if (!name) return -ENOMEM;
cpus = devm_kcalloc(dev, num_cpus, sizeof(*cpus), GFP_KERNEL); if (!cpus) return -ENOMEM;
codecs = devm_kcalloc(dev, num_codecs, sizeof(*codecs), GFP_KERNEL); if (!codecs) return -ENOMEM;
codec_maps = devm_kcalloc(dev, num_codecs, sizeof(*codec_maps), GFP_KERNEL); if (!codec_maps) return -ENOMEM;
list_for_each_entry(soc_end, &soc_dai->endpoints, list) { if (!soc_end->dai_info->direction[stream]) continue;
sdw_platform_component = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component),
GFP_KERNEL); if (!sdw_platform_component) return -ENOMEM;
switch (amd_ctx->acp_rev) { case ACP63_PCI_REV: case ACP70_PCI_REV: case ACP71_PCI_REV: case ACP72_PCI_REV:
sdw_platform_component->name = "amd_ps_sdw_dma.0"; break; default: return -EINVAL;
}
/* generate DAI links by each sdw link */ while (soc_dais->initialised) { int current_be_id = 0;
ret = create_sdw_dailink(card, soc_dais, dai_links,
¤t_be_id, codec_conf, sdw_platform_component); if (ret) return ret;
/* Update the be_id to match the highest ID used for SDW link */ if (*be_id < current_be_id)
*be_id = current_be_id;
ret = asoc_sdw_count_sdw_endpoints(card, &num_devs, &num_ends); if (ret < 0) {
dev_err(dev, "failed to count devices/endpoints: %d\n", ret); return ret;
}
/* One per DAI link, worst case is a DAI link for every endpoint */
soc_dais = kcalloc(num_ends, sizeof(*soc_dais), GFP_KERNEL); if (!soc_dais) return -ENOMEM;
/* One per endpoint, ie. each DAI on each codec/amp */
soc_ends = kcalloc(num_ends, sizeof(*soc_ends), GFP_KERNEL); if (!soc_ends) return -ENOMEM;
ret = asoc_sdw_parse_sdw_endpoints(card, soc_dais, soc_ends, &num_devs); if (ret < 0) return ret;
ctx->mc_quirk = soc_sdw_quirk;
dev_dbg(card->dev, "legacy quirk 0x%lx\n", ctx->mc_quirk); /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ for (i = 0; i < ctx->codec_info_list_count; i++)
codec_info_list[i].amp_num = 0;
ret = soc_card_dai_links_create(card); if (ret < 0) return ret;
/* * the default amp_num is zero for each codec and * amp_num will only be increased for active amp * codecs on used platform
*/ for (i = 0; i < ctx->codec_info_list_count; i++)
amp_num += codec_info_list[i].amp_num;
card->components = devm_kasprintf(card->dev, GFP_KERNEL, " cfg-amp:%d", amp_num); if (!card->components) return -ENOMEM; if (mach->mach_params.dmic_num) {
card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s mic:dmic cfg-mics:%d",
card->components,
mach->mach_params.dmic_num); if (!card->components) return -ENOMEM;
}
/* Register the card */
ret = devm_snd_soc_register_card(card->dev, card); if (ret) {
dev_err_probe(card->dev, ret, "snd_soc_register_card failed %d\n", ret);
asoc_sdw_mc_dailink_exit_loop(card); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.