Re: [PATCH v4 15/23] ASoC: soc-core: Identify 'no_pcm' DAI links for DPCM

From: Sameer Pujar
Date: Thu Jul 02 2020 - 05:56:35 EST




On 7/2/2020 2:20 PM, Kuninori Morimoto wrote:
External email: Use caution opening links or attachments


Hi Sameer

I wonder component->driver->non_legacy_dai_naming can't work for you ?
I see currently in simple-card driver that, BE<->BE link would be
treated as CODEC<->CODEC link if 'non_legacy_dai_naming' flag is set
at both ends of BE. Do we need to set this flag for all BE?
However I am not sure how this will work out for a BE<->BE DPCM DAI
link considering the fact that I want to use chain of components and I
guess routing map would get complicated. Also going by the flag name
it was not meant to differentiate between a FE and BE?
OK, non_legacy_dai_naming was just my quick idea.


Maybe your soc_component_is_pcm() idea can work,
but it seems a littl bit hackish for me.
So, can you please

1) Add soc_component_is_pcm() on simple-card, not soc-core ?
Maybe we can move it to soc-core later,
but want to keep it under simple-card, so far.

2) Use it with data->component_chaining, and some comment ?
non component_chaining user doesn't get damage in worst case,
and easy to understand.

/*
* This is for BE<->BE connection.
* It needs to ...
* It is assumng ...
* Note is ...
*/
if (data->component_chaining &&
!soc_component_is_pcm(cpus))
dai_link->no_pcm = 1;

3) maybe you can reuse snd_soc_find_dai() for soc_component_is_pcm() ?

dai = snd_soc_find_dai(dlc);
if (dai &&
(dai->pcm_new || dai->component->driver->pcm_construct))
return xxx

Sounds fine, I can make changes as per above points. Thanks.


Thank you for your help !!

Best regards
---
Kuninori Morimoto