diff options
Diffstat (limited to 'sound/soc/amd/acp/acp-sdw-legacy-mach.c')
| -rw-r--r-- | sound/soc/amd/acp/acp-sdw-legacy-mach.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c index 5a3cfedacbaf..fae94b9edd5a 100644 --- a/sound/soc/amd/acp/acp-sdw-legacy-mach.c +++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c @@ -360,20 +360,25 @@ static int soc_card_dai_links_create(struct snd_soc_card *card) struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; struct asoc_sdw_endpoint *soc_ends __free(kfree) = NULL; struct asoc_sdw_dailink *soc_dais __free(kfree) = NULL; + struct snd_soc_aux_dev *soc_aux; struct snd_soc_codec_conf *codec_conf; struct snd_soc_dai_link *dai_links; int num_devs = 0; int num_ends = 0; + int num_aux = 0; + int num_confs; int num_links; int be_id = 0; int ret; - ret = asoc_sdw_count_sdw_endpoints(card, &num_devs, &num_ends); + ret = asoc_sdw_count_sdw_endpoints(card, &num_devs, &num_ends, &num_aux); if (ret < 0) { dev_err(dev, "failed to count devices/endpoints: %d\n", ret); return ret; } + num_confs = num_ends; + /* 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) @@ -384,7 +389,11 @@ static int soc_card_dai_links_create(struct snd_soc_card *card) if (!soc_ends) return -ENOMEM; - ret = asoc_sdw_parse_sdw_endpoints(card, soc_dais, soc_ends, &num_devs); + soc_aux = devm_kcalloc(dev, num_aux, sizeof(*soc_aux), GFP_KERNEL); + if (!soc_aux) + return -ENOMEM; + + ret = asoc_sdw_parse_sdw_endpoints(card, soc_aux, soc_dais, soc_ends, &num_confs); if (ret < 0) return ret; @@ -396,7 +405,7 @@ static int soc_card_dai_links_create(struct snd_soc_card *card) dev_dbg(dev, "sdw %d, dmic %d", sdw_be_num, dmic_num); - codec_conf = devm_kcalloc(dev, num_devs, sizeof(*codec_conf), GFP_KERNEL); + codec_conf = devm_kcalloc(dev, num_confs, sizeof(*codec_conf), GFP_KERNEL); if (!codec_conf) return -ENOMEM; @@ -407,9 +416,11 @@ static int soc_card_dai_links_create(struct snd_soc_card *card) return -ENOMEM; card->codec_conf = codec_conf; - card->num_configs = num_devs; + card->num_configs = num_confs; card->dai_link = dai_links; card->num_links = num_links; + card->aux_dev = soc_aux; + card->num_aux_devs = num_aux; /* SDW */ if (sdw_be_num) { @@ -463,6 +474,10 @@ static int mc_probe(struct platform_device *pdev) card->late_probe = asoc_sdw_card_late_probe; snd_soc_card_set_drvdata(card, ctx); + if (mach->mach_params.subsystem_id_set) + snd_soc_card_set_pci_ssid(card, + mach->mach_params.subsystem_vendor, + mach->mach_params.subsystem_device); dmi_check_system(soc_sdw_quirk_table); |
