[alsa-devel] [RFT v2 6/6] ASoC: core: Add support for DAI multicodec

Lars-Peter Clausen lars at metafoo.de
Tue Mar 25 18:01:43 CET 2014


On 03/25/2014 02:10 PM, Benoit Cousson wrote:
[...]
>>> +struct snd_soc_dai_link_codec {
>>
>> For the sake of symmetry maybe name this snd_soc_dai_link_component and
>> drop the 'codec_' prefix in front of the struct fields. There is no
>> reason why this couldn't be used for CPU dais as well at some point.
>
> OK, good point.
>
>>> +    const char *codec_name;
>>> +    const struct device_node *codec_of_node;
>>> +    const char *codec_dai_name;
>>
>> I'd like to see this split up into the descriptive part that holds the
>> name, of_node etc, and the runtime data that holds the pointer to the
>> DAIs. The descriptive part goes in the dai_link struct the. The pointers
>> to the DAIs go into the snd_soc_pcm_runtime struct. This is how it is
>> used the only place where you need both is in soc_bind_dai_link.
>
> OK, let me try to clarify that. You suggest to create that struct:
>
> +struct snd_soc_dai_link_component {
> +    const char *name;
> +    const struct device_node *of_node;
> +    const char *dai_name;
> +}
>
> to be inside the snd_soc_dai_link.
>
> And inside the snd_soc_pcm_runtime, to replace these ones
> +    struct snd_soc_dai_link_codec *codecs;
> +    int num_codecs;
>
> with a direct pointers to codecs dais?
>
> +    struct snd_soc_dai **codecs_dai;
> +    int num_codecs;
>
> Is that correct ?

Yes. Should be unsigned int though ;)

- Lars




More information about the Alsa-devel mailing list