summaryrefslogtreecommitdiff
path: root/sound/soc/amd/acp
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2025-11-27 16:34:22 +0000
committerMark Brown <broonie@kernel.org>2025-11-27 19:18:47 +0000
commit26ee34d2f5c7fba968fcc2f1fd94110e1c1660db (patch)
treeefcfe92f774647c0ead15485b3583591cfa05599 /sound/soc/amd/acp
parent48fa77af2f4a55ab961520f2a0e50560dc0baca8 (diff)
downloadlinux-next-26ee34d2f5c7fba968fcc2f1fd94110e1c1660db.tar.gz
linux-next-26ee34d2f5c7fba968fcc2f1fd94110e1c1660db.zip
ASoC: sdw_utils: Add codec_conf for every DAI
The assumption so far is that all the DAI links for a given audio part would be on the same device. However, as SDCA implements each audio function on a separate auxiliary driver this will no longer be true. This means it is necessary to add additional codec_conf structures to get the prefix for an audio part to apply to all the auxiliary drivers that make up that part. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251127163426.2500633-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp')
-rw-r--r--sound/soc/amd/acp/acp-sdw-legacy-mach.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c
index 54f823f7cecf..f1f43eeb6037 100644
--- a/sound/soc/amd/acp/acp-sdw-legacy-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c
@@ -364,6 +364,7 @@ static int soc_card_dai_links_create(struct snd_soc_card *card)
struct snd_soc_dai_link *dai_links;
int num_devs = 0;
int num_ends = 0;
+ int num_confs;
int num_links;
int be_id = 0;
int ret;
@@ -374,6 +375,8 @@ static int soc_card_dai_links_create(struct snd_soc_card *card)
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 +387,7 @@ 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);
+ ret = asoc_sdw_parse_sdw_endpoints(card, soc_dais, soc_ends, &num_confs);
if (ret < 0)
return ret;
@@ -396,7 +399,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,7 +410,7 @@ 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;