mbox series

[0/4] ASoC:: don't use snd_soc_rtdcom_lookup()

Message ID 87d080unyx.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series ASoC:: don't use snd_soc_rtdcom_lookup() | expand

Message

Kuninori Morimoto April 22, 2020, 4:46 a.m. UTC
Hi Mark
Cc related engineer

These patches are tring to not to use snd_soc_rtdcom_lookup() function
on each drivers as much as possible,  because we might have same name
component under multi component situation.
It can't find correct component in such case.

I tried to add new feature on each drivers to not to use it,
but I can't test.
Thus, these patches should get Acked-by or Tested-by from each drivers
user/maintenor. Please test these.

After these patches, Intel / SOF drivers are still using
snd_soc_rtdcom_lookup(). Because it is very complex, I couldn't try
not to use it.
If possible, each drivers should try to not use it,
and it should be removed from ASoC.

Kuninori Morimoto (4):
  ASoC: mediatek: don't use snd_soc_rtdcom_lookup()
  ASoC: intel: baytrail: don't use snd_soc_rtdcom_lookup()
  ASoC: intel: haswell: don't use snd_soc_rtdcom_lookup()
  ASoC: amd: don't use snd_soc_rtdcom_lookup()

 sound/soc/amd/raven/acp3x-pcm-dma.c         |  6 ------
 sound/soc/intel/baytrail/sst-baytrail-pcm.c | 13 +++++++------
 sound/soc/intel/haswell/sst-haswell-pcm.c   |  4 +++-
 sound/soc/mediatek/common/mtk-afe-fe-dai.c  | 12 +++++-------
 sound/soc/mediatek/common/mtk-afe-fe-dai.h  |  3 ++-
 sound/soc/mediatek/common/mtk-base-afe.h    |  6 ++++--
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c  |  6 ++++--
 sound/soc/mediatek/mt6797/mt6797-afe-pcm.c  | 11 ++++-------
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c  |  7 ++++---
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c  | 11 ++++-------
 10 files changed, 37 insertions(+), 42 deletions(-)

Comments

Ranjani Sridharan April 22, 2020, 5:39 a.m. UTC | #1
On Wed, 2020-04-22 at 13:46 +0900, Kuninori Morimoto wrote:
> Hi Mark
> Cc related engineer
> 
> These patches are tring to not to use snd_soc_rtdcom_lookup()
> function
> on each drivers as much as possible,  because we might have same name
> component under multi component situation.
> It can't find correct component in such case.
> 
> I tried to add new feature on each drivers to not to use it,
> but I can't test.
> Thus, these patches should get Acked-by or Tested-by from each
> drivers
> user/maintenor. Please test these.
> 
> After these patches, Intel / SOF drivers are still using
> snd_soc_rtdcom_lookup(). Because it is very complex, I couldn't try
> not to use it.
> If possible, each drivers should try to not use it,
> and it should be removed from ASoC.
Morimoti-san,

For my education, I understand the concept of multi-cpu/codec
components, but when or who would need multiple platform components?
This would help me able to remove the snd_soc_rtdcom_lookup() call in
SOF.

Thanks,
Ranjani
Kuninori Morimoto April 22, 2020, 10:12 p.m. UTC | #2
Hi

Hi Ranjani

> > These patches are tring to not to use snd_soc_rtdcom_lookup()
> > function
> > on each drivers as much as possible,  because we might have same name
> > component under multi component situation.
> > It can't find correct component in such case.
> > 
> > I tried to add new feature on each drivers to not to use it,
> > but I can't test.
> > Thus, these patches should get Acked-by or Tested-by from each
> > drivers
> > user/maintenor. Please test these.
> > 
> > After these patches, Intel / SOF drivers are still using
> > snd_soc_rtdcom_lookup(). Because it is very complex, I couldn't try
> > not to use it.
> > If possible, each drivers should try to not use it,
> > and it should be removed from ASoC.
> Morimoti-san,
> 
> For my education, I understand the concept of multi-cpu/codec
> components, but when or who would need multiple platform components?
> This would help me able to remove the snd_soc_rtdcom_lookup() call in
> SOF.

I don't know concrete system.
But it is "possible" today.
And, we don't know the future system,
having flexibility is good idea, I think.

I'm thinking removing lookup function is nice idea,
but don't feel pressure to it.
"Now you know it" is very enough for me.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Ranjani Sridharan April 22, 2020, 10:39 p.m. UTC | #3
On Thu, 2020-04-23 at 07:12 +0900, Kuninori Morimoto wrote:
> Hi
> 
> Hi Ranjani
> 
> > > These patches are tring to not to use snd_soc_rtdcom_lookup()
> > > function
> > > on each drivers as much as possible,  because we might have same
> > > name
> > > component under multi component situation.
> > > It can't find correct component in such case.
> > > 
> > > I tried to add new feature on each drivers to not to use it,
> > > but I can't test.
> > > Thus, these patches should get Acked-by or Tested-by from each
> > > drivers
> > > user/maintenor. Please test these.
> > > 
> > > After these patches, Intel / SOF drivers are still using
> > > snd_soc_rtdcom_lookup(). Because it is very complex, I couldn't
> > > try
> > > not to use it.
> > > If possible, each drivers should try to not use it,
> > > and it should be removed from ASoC.
> > 
> > Morimoti-san,
> > 
> > For my education, I understand the concept of multi-cpu/codec
> > components, but when or who would need multiple platform
> > components?
> > This would help me able to remove the snd_soc_rtdcom_lookup() call
> > in
> > SOF.
> 
> I don't know concrete system.
> But it is "possible" today.
> And, we don't know the future system,
> having flexibility is good idea, I think.
> 
> I'm thinking removing lookup function is nice idea,
> but don't feel pressure to it.
> "Now you know it" is very enough for me.
I am having a hard time visualizing a scenario where we would have more
than one platform component. And even if we did, I'd think that the
driver registering these components would make sure to not duplicate
the driver names. Of course, we dont really check if thats really the
case. 
Do you think it makes sense to add that check when registering a
component? If we do that, then keeping snd_soc_rtdcom_lookup() might
not be such a bad idea. 

Thanks,
Ranjani
Kuninori Morimoto April 22, 2020, 11:56 p.m. UTC | #4
Hi Ranjani

> I am having a hard time visualizing a scenario where we would have more
> than one platform component. And even if we did, I'd think that the
> driver registering these components would make sure to not duplicate
> the driver names. Of course, we dont really check if thats really the
> case. 
> Do you think it makes sense to add that check when registering a
> component? If we do that, then keeping snd_soc_rtdcom_lookup() might
> not be such a bad idea. 

If noone uses lookup function, having same name component itself
is not a problem.

If component driver handles different component naming, and user-driver
can knows it somehow, using lookup function is not a problem either.
But, I think "how to specific the component name" from user-driver
is difficult.
Thus, this patch-set try to avoid it by adding small feature
even though under such situation.

So, keeping lookup function itself is possible.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Mark Brown April 23, 2020, 10:53 a.m. UTC | #5
On Wed, Apr 22, 2020 at 03:39:58PM -0700, Ranjani Sridharan wrote:
> On Thu, 2020-04-23 at 07:12 +0900, Kuninori Morimoto wrote:

> > I'm thinking removing lookup function is nice idea,
> > but don't feel pressure to it.
> > "Now you know it" is very enough for me.

> I am having a hard time visualizing a scenario where we would have more
> than one platform component. And even if we did, I'd think that the
> driver registering these components would make sure to not duplicate
> the driver names. Of course, we dont really check if thats really the
> case. 

The only use case I can think of is a link where there's a CPU on both
ends for some reason.

> Do you think it makes sense to add that check when registering a
> component? If we do that, then keeping snd_soc_rtdcom_lookup() might
> not be such a bad idea. 

Yeah.
Ranjani Sridharan April 23, 2020, 3:31 p.m. UTC | #6
On Thu, 2020-04-23 at 11:53 +0100, Mark Brown wrote:
> On Wed, Apr 22, 2020 at 03:39:58PM -0700, Ranjani Sridharan wrote:
> > On Thu, 2020-04-23 at 07:12 +0900, Kuninori Morimoto wrote:
> > > I'm thinking removing lookup function is nice idea,
> > > but don't feel pressure to it.
> > > "Now you know it" is very enough for me.
> > I am having a hard time visualizing a scenario where we would have
> > more
> > than one platform component. And even if we did, I'd think that the
> > driver registering these components would make sure to not
> > duplicate
> > the driver names. Of course, we dont really check if thats really
> > the
> > case. 
> 
> The only use case I can think of is a link where there's a CPU on
> both
> ends for some reason.
> 
> > Do you think it makes sense to add that check when registering a
> > component? If we do that, then keeping snd_soc_rtdcom_lookup()
> > might
> > not be such a bad idea. 
> 
> Yeah.
Thanks, Mark. Let me send a patch to handle this check in the core.

Thanks,
Ranjani