[alsa-devel] [RFC 0/x v2] ASoC: replace platform to component
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Mon Jun 26 10:51:15 CEST 2017
Hi Mark, Lars-Peter
These are v2 of platform replace patch-set.
Big difference is that from version, rtd can have component list.
As you know, current rtd has platform, codec, and this patch
replace rtd->platform into component list.
We can replace codec in same style in the future.
This patch-set adds new snd_soc_rtdcom_lookup().
So, current
struct snd_soc_platform *platform = rtd->platform;
will be replaced into
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRIVER_NAME);
1 rtd doesn't detect same component multiple times, I guess.
Thus, lookup by driver name should be OK.
Current framework is listing component to card (it was originally codec) by component_dev_list.
And it is used in soc-pcm.c
list_for_each_entry(component, &rtd->card->component_dev_list, card_list) {
...
}
But it is not correct I think.
card can have multiple runtimes, and runtime can have multiple components.
Thus, I think we can do below case ?
Card -+-> runtime1 -> component1 + component2
+-> runtime2 -> component1 + component2
+-> runtime3 -> component1 + component3
Current list_for_each_entry() will call component1/2/3,
but runtime1 needs component1/2 only, for example.
It is connecting all components to card by component_dev_list.
OTOH, all runtimes are listed to card by rtd_list.
This patch lists component to runtime.
I think we can replace component_dev_list into
for_each_rtdcom(rtd, rtdcom) {
component = rtdcom->component;
...
}
1) - 5) : prepare to replace
6) - 8) : sample of platform -> component replace
9) : remove platform
Kuninori Morimoto (9):
1) ASoC: soc-core: add component remove/unregister_exp/lookup functions
2) ASoC: soc-devres: use expanded unregister on devm register component
3) ASoC: soc-core: add snd_soc_rtdcom_xxx()
4) ASoC: snd_soc_component_driver has snd_pcm_ops
5) ASoC: snd_soc_component_driver has snd_compr_ops
6) ASoC: replace platform to component on rsnd
7) ASoC: replace platform to component on soc-utils
8) ASoC: replace platform to component on soc-generic-dmaengine-pcm
9) ASoC: remove platform related things
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list