[alsa-devel] [PATCH RFC 1/3] ASoC: Add initial support for multiple CPU DAIs

Liao, Bard bard.liao at intel.com
Thu Dec 26 10:15:38 CET 2019



> -----Original Message-----
> From: Kuninori Morimoto [mailto:kuninori.morimoto.gx at renesas.com]
> Sent: Thursday, December 26, 2019 4:17 PM
> To: Bard liao <yung-chuan.liao at linux.intel.com>
> Cc: broonie at kernel.org; alsa-devel at alsa-project.org; tiwai at suse.de;
> liam.r.girdwood at linux.intel.com; pierre-louis.bossart at linux.intel.com; Liao,
> Bard <bard.liao at intel.com>
> Subject: Re: [PATCH RFC 1/3] ASoC: Add initial support for multiple CPU DAIs
> 
> 
> Hi Bard
> 
> Actually I have plan to post semi-multi CPU DAI support as part of ASoC cleanup.
> The reason why "semi-multi" is that I can't test all features.
> It cares Multi-CPU as much as possible.
> 
> Thus, your and my patches are 100% conflict :) But, it is OK for me.
> I'm happy to adjust to yours.
> 
> Some comment from me
> 
> > From: Shreyas NC <shreyas.nc at intel.com>
> >
> > ASoC core supports multiple codec DAIs but supports only a CPU DAI.
> > To support multiple cpu DAIs, add cpu_dai and num_cpu_dai in
> > snd_soc_dai_link and snd_soc_pcm_runtime structures similar to support
> > for codec_dai. This is intended as a preparatory patch to eventually
> > support the unification of the Codec and CPU DAI.
> >
> > Inline with multiple codec DAI approach, add support to allocate,
> > init, bind and probe multiple cpu_dai on init if driver specifies
> > that. Also add support to loop over multiple cpu_dai during suspend
> > and resume.
> >
> > This is intended as a preparatory patch to eventually unify the CPU
> > and Codec DAI into DAI components.
> >
> > Signed-off-by: Shreyas NC <shreyas.nc at intel.com>
> > Signed-off-by: Bard Liao <yung-chuan.liao at linux.intel.com>
> > ---
> (snip)
> > @@ -1149,6 +1154,9 @@ struct snd_soc_pcm_runtime {
> >  	struct snd_soc_dai **codec_dais;
> >  	unsigned int num_codecs;
> >
> > +	struct snd_soc_dai **cpu_dais;
> > +	unsigned int num_cpu_dai;
> 
> Codec is using "num_codecs";
> So, I think "num_cpus" is better for CPU.

Agree. I will update it.

> 
> 
> > @@ -1020,14 +1036,6 @@ static int soc_dai_link_sanity_check(struct
> snd_soc_card *card,
> >  			return -EPROBE_DEFER;
> >  	}
> >
> > -	/* FIXME */
> > -	if (link->num_cpus > 1) {
> > -		dev_err(card->dev,
> > -			"ASoC: multi cpu is not yet supported %s\n",
> > -			link->name);
> > -		return -EINVAL;
> > -	}
> > -
> >  	/*
> >  	 * CPU device may be specified by either name or OF node, but
> >  	 * can be left unspecified, and will be matched based on DAI
> 
> I think you want to sanity check for each CPU DAI by using
> for_each_rtd_cpu_dai() here, not only removing FIXME ?

Sure, thanks for reminding.

> 
> 
> 
> 
> In my quick check, I think your patch-set doesn't care these functions ?
> # Mine version is also doesn't care. Thus it indicates warning message there.
> # Because I'm not sure how to handle these...
> 
> 	- soc_init_pcm_runtime()
> 	- snd_dmaengine_pcm_prepare_slave_config()
> 	- dmaengine_pcm_set_runtime_hwparams()
> 	- dmaengine_pcm_compat_request_channel()
> 	- dpcm_state_read_file()
> 	- dpcm_path_get()
> 	- dpcm_runtime_merge_chan()
> 	- soc_new_pcm()
> 	- soc_dpcm_fe_runtime_update()
> 
> For soc_new_pcm(), I think you need to care playback/capture flag for Multi-
> CPU/Codec.
> 
> For soc_dpcm_fe_runtime_update(),
> you need to care about Multi-CPU.
> But, it doesn't care Multi-Codec, either...
> 
> I attached mine version.

Thank you very much for the comments and patch.
I will read your version and merge our versions.
Thanks again for the quick reply.

> 
> Thank you for your help !!
> Best regards
> ---
> Kuninori Morimoto


More information about the Alsa-devel mailing list