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

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Jun 21 06:32:30 CEST 2017


Hi Mark, Lars-Peter

> 1st Note is that it is still using rtd->platform_com style.

It is still using this "rtd->xxx" style, but we should expand it.
I'm thinking that we can connect each component to rtd by using list
and we can get it by "driver" (or something).
Then, we can add new snd_soc_lookup_runtime() function for it.
But, what do you think ?

	- rtd->platform_com = component;
	+ list_add(component->rtd_list, rtd->list_head);

	- struct device *dev = rtd->platform_com->dev;
	+ struct snd_soc_component *component = snd_soc_lookup_runtime(rtd, driver);
	+ struct device *dev = component->dev;

struct snd_soc_component *snd_soc_lookup_runtime(rtd, driver)
{
	...
	list_for_each_entry(component, &rtd->list_head, xxx) {
		if (driver == component->driver)
			return component;
	}

	return NULL;
}


Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list