[alsa-devel] [PATCH 0/7][RFC] ASoC: modern style CPU

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Tue Apr 16 04:48:23 CEST 2019


> I know you are already working for it for Intel
> 
> 	https://github.com/plbossart/sound/commits/fix/codec-legacy-dai
> 
> and, it will be conflict to my posted patch style.
> 
> 	https://patchwork.kernel.org/patch/10888741/
> 	https://patchwork.kernel.org/patch/10888745/
> 
> So, I can avoid to posting patch for Intel,
> then, you need to update it again for modern style CPU.
> Or, I can update Intel by using above macro.
> What is your opinion ?

I must admit I didn't look at the new style. With all due respect I am 
not sold, it's becoming a lot less intuitive and readable, e.g.:

+SND_SOC_DAI_LINK_CCP(aif1,
+	SND_SOC_DAI_LINK(SDL_CPU("samsung-i2s.0")),
+	SND_SOC_DAI_LINK(SDL_CODEC("wm8994-codec", "wm8994-aif1")),
+	SND_SOC_DAI_LINK(SDL_PLATFORM("samsung-i2s.0")));
+
+SND_SOC_DAI_LINK_CCP(fifo_tx,
+	SND_SOC_DAI_LINK(SDL_CPU("samsung-i2s-sec")),
+	SND_SOC_DAI_LINK(SDL_CODEC("wm8994-codec", "wm8994-aif1")),
+	SND_SOC_DAI_LINK(SDL_PLATFORM("samsung-i2s-sec")));
+
  static struct snd_soc_dai_link smdk_dai[] = {
  	{ /* Primary DAI i/f */
  		.name = "WM8994 AIF1",
  		.stream_name = "Pri_Dai",
-		.cpu_dai_name = "samsung-i2s.0",
-		.codec_dai_name = "wm8994-aif1",
-		.platform_name = "samsung-i2s.0",
-		.codec_name = "wm8994-codec",
  		.init = smdk_wm8994_init_paiftx,
  		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
  			SND_SOC_DAIFMT_CBM_CFM,
  		.ops = &smdk_ops,
+		SND_SOC_LINK_CCP(aif1),

is this really the new direction?
Even the acronyms are not simple, it took me 15mn to figure out that CCP 
stood for CPU/Codec/Platform and I couldn't figure out what SDL means. 
The multiple repetitions of SND_SOC_DAI_LINK is also misleading, it's 
just a property of the *same* dailink that you handle.

I am even more nervous since we have a need to explicitly some cpu and 
codec dai names depending on quirks, with the additional abstraction 
it'll become plain unreadable - or we need new helpers.


More information about the Alsa-devel mailing list