About ALSA SoC cpu/codec asymmetry
Hi Mark, Stephen, Lars
Now, ALSA SoC is using "component" style, and its image is like this.
ALSA SoC
- platform
- component (as CPU)
- codec
- component
It is still not symmetry, and confusable.
I guess this is understandable.
ALSA SoC
- platform
- cpu
- component
- codec
- component
If we add "cpu", it needs "cpu name", same as current "codec name"
on soc_bind_dai_link().
I guess it can keep compatible if it allows "NULL" name on "cpu name" at this point. (but print warning ?)
What do you think ?
Best regards
---
Kuninori Morimoto
Quoted 21 lines · Kuninori Morimoto
Hi Mark, Stephen, Lars
Now, ALSA SoC is using "component" style, and its image is like this.
ALSA SoC
- platform
- component (as CPU)
- codec
- componentIt is still not symmetry, and confusable.
I guess this is understandable.ALSA SoC
- platform
- cpu
- component
- codec
- component
Quoted 4 lines
If we add "cpu", it needs "cpu name", same as current "codec name"
onsoc_bind_dai_link().
I guess it can keep compatible if it allows "NULL" name on "cpu name" at this point. (but print warning ?)
There is already a cpu_name field for the DAI link struct and it is ignored when it is NULL. See http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/sound/soc/soc-core.c#n870
I have a patch that makes using cpu_name mandatory for new component drivers. And then we can slowly start to convert old platforms.
- Lars
Hi Lars
Quoted 3 lines
There is already a
cpu_namefield for the DAI link struct and it is ignored when it is NULL. See
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/sound/soc/soc-core.c#n870
indeed
Thanks
Quoted 2 lines
I have a patch that makes using
cpu_namemandatory for new component drivers. And then we can slowly start to convert old platforms.
Nice !
Basically, my worry is cpu/codec "asymmetry" data structure. (Maybe it came from "historical" reason?)
I would like to have new "struct snd_soc_cpu" and "snd_soc_register_cpu()" instead of current "component" if possible.
It is understandable.
Quoted 10 lines · Kuninori Morimoto
Hi Lars
Quoted 3 lines
There is already a
cpu_namefield for the DAI link struct and it is ignored when it is NULL. See
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/sound/soc/soc-core.c#n870indeed
Thanks
Quoted 7 lines
Quoted 2 lines
I have a patch that makes using
cpu_namemandatory for new component drivers. And then we can slowly start to convert old platforms.Nice !
Basically, my worry is cpu/codec "asymmetry" data structure. (Maybe it came from "historical" reason?)
Yep.
Quoted 4 lines
I would like to have new "struct
snd_soc_cpu" and "snd_soc_register_cpu()" instead of current "component" if possible.
It is understandable.
The patchset I'm working goes the other direction. The idea is to eventually remove snd_soc_codec and only have snd_soc_component. With modern SoCs the CPU side isn't just a dumb DAI anymore, but you often have signal routing and mixing capabilities, sample rate converters, sometimes even a full DSP. And then there are also those SoCs which have a DAC and/or ADC directly built-in. This makes them complexity wise similar to the CODEC side and having things like DAPM and our set of standard predefined kcontrols makes it easier to manage them.
- Lars
Hi Lars
Quoted 4 lines
Quoted 3 lines
I would like to have new "struct
snd_soc_cpu" and "snd_soc_register_cpu()" instead of current "component" if possible.
It is understandable.
Quoted 8 lines
The patchset I'm working goes the other direction. The idea is to eventually remove
snd_soc_codecand only havesnd_soc_component. With modern SoCs the CPU side isn't just a dumb DAI anymore, but you often have signal routing and mixing capabilities, sample rate converters, sometimes even a full DSP. And then there are also those SoCs which have a DAC and/or ADC directly built-in. This makes them complexity wise similar to the CODEC side and having things like DAPM and our set of standard predefined kcontrols makes it easier to manage them.
Ahh, very nice !
I can 100% agree to your idea :)
Sorry for my noise, I didn't know your (or ALSA SoC ?) plan
Please let me know if you need my help (maybe some test ?)
Quoted 16 lines · Kuninori Morimoto
Hi Lars
Quoted 4 lines
Quoted 3 lines
I would like to have new "struct
snd_soc_cpu" and "snd_soc_register_cpu()" instead of current "component" if possible.
It is understandable.Quoted 8 lines
The patchset I'm working goes the other direction. The idea is to eventually remove
snd_soc_codecand only havesnd_soc_component. With modern SoCs the CPU side isn't just a dumb DAI anymore, but you often have signal routing and mixing capabilities, sample rate converters, sometimes even a full DSP. And then there are also those SoCs which have a DAC and/or ADC directly built-in. This makes them complexity wise similar to the CODEC side and having things like DAPM and our set of standard predefined kcontrols makes it easier to manage them.
Quoted 6 lines
Ahh, very nice !
I can 100% agree to your idea :)
Sorry for my noise, I didn't know your (or ALSA SoC ?) planPlease let me know if you need my help (maybe some test ?)
Sure, I'll keep you on Cc for the patches.
- Lars