[alsa-devel] [PATCH 0/x] ASoC: replace platform to component

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Jul 25 05:58:56 CEST 2017


Hi Mark

These are for replace "platform" to "component".
It needs 3 steps I think.
 step1. "component" needs _add_ function, like "platform"
 step2. "component" level pcm_new/free support
 step3. replace platform to component

We can get platform pointer from rtd->platform on current style.
But these are very categorized pointer, in other words, non generic pointer.
This cleanup is 1st step of merging all feature into component.
I think new style wil be

	CPU + Codec + Platform = Component

I think merging CPU into Component is already done.
This patch set merges Platform feature into Component, and remove Platform. 
Merging Codec into Component is next step.

This patch set will add new rtd connected component list.
All CPU/Codec/Platform are connected to this list.
And we can get each component pointer by using rtd and its driver name.
Here, We can replace rtd->platform like below

-	struct device *dev = rtd->platform->dev;
+	struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRIVER_NAME);
+	struct device *dev = component->dev;


-	if(rtd->platform->pcm_new)
-		rtd->platform->pcm_new(yyy);
+	for_each_rtdcom(rtd, rtdcom) {
+		component = rtdcom->component; /* rtd connected CPU/Codec/Platform */
+		if (component->pcm_new)
+			component->pcm_new(yyy);
+	}

Now, only platform has pcm_new/free, but in new style,
all component can have it.

I will post step1/2/3 patch-set.
step1 is normal patches.
step2/3 are now still [RFC].

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list