[PATCH 0/7] ASoC: Merge CPU/Codec DAIs

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed Mar 11 02:51:43 CET 2020


Hi Morimoto-san,

On 3/10/20 8:06 PM, Kuninori Morimoto wrote:
> 
> Hi Mark
> 
> Current ALSA SoC has CPU/Codec categorized DAIs.
> But it will be no longer good much for modern device.
> 
> Currently, rtd has both CPU/Codec DAIs array.
> 
> 	rtd->cpu_dais   = [][][][][][][][][]
> 	rtd->codec_dais = [][][][][][][][][]
> 
> This patch merges these, like below.
> It still keeps rtd->cpu_dais, rtd->codec_dais

Sorry, but I perceive a contradiction here, or I am missing the bigger 
picture.

Is the end-goal to remove the cpu_dais and codec_dais, and fold them as 
non-descript 'dais'? This is what I understand by "it will be no longer 
good much for modern device"

Or is this 'merge' a simple data handling change to avoid using two 
"for" loops instead of one, and we are going to keep the distinction 
between dais?

more specifically I am concerned about the tons of code we have, e.g. a 
random machine driver:

	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	struct snd_soc_jack *jack;
	int ret;

	/* Configure sysclk for codec */
	ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK,

If the rtd structure only has an array of dais, how would the codecs be 
configured then?
	
> 
> 	rtd->dais = [][][][][][][][][][][][][][][][][][]
> 	            ^cpu_dais         ^codec_dais
> 	            |--- num_cpus ---|--- num_codecs --|
> 
> After this merging, we can merge for_each_rtd_cpu/codec_dais().
> 
> -	for_each_rtd_cpu_dais() {
> -		...
> -	}
> -	for_each_rtd_codec_dais() {
> -		...
> -	}
> +	for_each_rtd_dais() {
> +		...
> +	}
> 
> 
> Kuninori Morimoto (7):
>    ASoC: soc-core: Merge CPU/Codec DAIs
>    ASoC: soc-core: Merge for_each_rtd_cpu/codec_dais()
>    ASoC: soc-dapm: Merge for_each_rtd_cpu/codec_dais()
>    ASoC: soc-pcm: Merge for_each_rtd_cpu/codec_dais()
>    ASoC: soc-core: Merge CPU/Codec for soc_dai_pcm_new()
>    ASoC: soc-pcm: Merge CPU/Codec MSB at soc_pcm_apply_msb()
>    ASoC: soc-pcm: Merge CPU/Codec at soc_pcm_pointer()
> 
>   include/sound/soc.h  |   7 +-
>   sound/soc/soc-core.c |  66 +++-----
>   sound/soc/soc-dapm.c |   9 +-
>   sound/soc/soc-pcm.c  | 367 +++++++++++--------------------------------
>   4 files changed, 123 insertions(+), 326 deletions(-)
> 


More information about the Alsa-devel mailing list