Re: [RFC PATCH 01/23] ASoC: soc-core: allow default ch_maps on links with more than 8 DAIs
From: Mark Brown
Date: Sun Nov 15 2026 - 12:36:50 EST
> snd_soc_compensate_channel_connection_map() builds the default channel
> map from static 8-entry arrays and fails the card for links with more
> DAIs. A speaker protection link carrying both the amplifier and the V/I
> sense codec DAIs of four speakers has about sixteen.
>
> Keep the static arrays for links that fit, and allocate a per-link map
> with the same 1:1, 1:N or N:1 layout for those that do not.
> @@ -915,20 +915,40 @@ static int snd_soc_compensate_channel_connection_map(struct snd_soc_card *card,
> + if (dai_link->num_cpus <= MAX_DEFAULT_CH_MAP_SIZE &&
> + dai_link->num_codecs <= MAX_DEFAULT_CH_MAP_SIZE) {
> + } else {
> + int num_maps = max(dai_link->num_cpus, dai_link->num_codecs);
> + ch_maps = devm_kcalloc(card->dev, num_maps, sizeof(*ch_maps),
This is a dynamic allocation bound to the card's device but it ends up
in the dai link which might be stored as static data in the machine
driver and get reused on a rebind.
--
Mark Brown <broonie@xxxxxxxxxx>