Re: [PATCH v2 01/24] ASoC: soc-core: always allocate default ch_maps

From: Srinivas Kandagatla

Date: Mon Nov 30 2026 - 06:09:48 EST


On 11/30/26 4:31 AM, Kuninori Morimoto wrote:
>
> Hi Srinivas
>
>> The default ch_maps come from three file-scope static tables of twelve
>> entries each, and links wider than twelve DAIs are rejected up front.
>> The cap is arbitrary -- the tables encode "cpu = i" or "codec = i",
>> information soc-core can synthesize at bind time for any link width.
>>
>> Replace the static tables with a devm allocation on card->dev sized
>> to the link, and drop the MAX_DEFAULT_CH_MAP_SIZE check.
>
> Hmm... do we need to alloc ch_maps for each links ?
> Except N:M connections, the pattern is same.
> We can share the same maps.
>
Thanks Kuninori,

> Current size of MAX_DEFAULT_CH_MAP_SIZE (= 12 current) is no meaning,
We have two choices
1. to keep updating MAX_DEFAULT_CH_MAP_SIZE, in my case for 18 it will
increase .rodata by few bytes. I can get away with changing this for now.

2. looking at the users of this ch_maps from for_each_rtd_ch_maps, all
we need is an entry based on dai link num_cpus and num_codecs provided
by core if machine driver does not provide ch_maps. We can add small
helper to return these value for a given dai_link and avoid the table
and MAX_DEFAULT_CH_MAP_SIZE together. That is something that I can look
at if we prefer this option.


--srini

> just a temporary placement that I have thought enough size.
> If you need to have more size, please update it.
>
> Thank you for your help !!
>
> Best regards
> ---
> Kuninori Morimoto