mbox series

[00/15,RFC] ASoC: use snd_soc_dai_link_component style for simple card

Message ID 878t51vdd3.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series ASoC: use snd_soc_dai_link_component style for simple card | expand

Message

Kuninori Morimoto Aug. 20, 2018, 5:09 a.m. UTC
Hi Mark

I think ALSA SoC framework needs more update for modern style
As 1st step, codec/plaform are updated/converted to component style.
I think 2nd step is DAI/dai_link matching.
We want to use snd_soc_dai_link_component style instead of
legacy style for dai_link matching for CPU/Codec/Platform.
like this.

	[current]
	struct snd_soc_dai_link {
		...
		*cpu_name;
		*cpu_of_node;
		*cpu_dai_name;

		*codec_name;
		*codec_of_node;
		*codec_dai_name;
		*codecs;
		num_codecs;

		*platform_name;
		*platform_of_node;
		...
	}

	[we want]
	struct snd_soc_dai_link {
		...
		*cpus
		num_cpus;

		*codecs;
		num_codecs;

		*platform;
		...
	}

Above sample is still using CPU/Codec/Platform.
We can merge it into same snd_soc_dai_link_component list
if someone wants it. But anyway, CPU/Codec/Platform style
is not so bad, so far.

It will be more useful/simple code if we can use
snd_soc_dai_link_component for DAI instead of
xxx_name / xxx_of_node / xxx_dai_name.

Currently, only Codec is supporting/using snd_soc_dai_link_component
style. But we want to use it for CPU/Platform, too.
I know Shreyas is posting multi CPU style, then, it can support
snd_soc_dai_link_component style.

Using snd_soc_dai_link_component style for Platform is not difficult
I think. [09/15] patch add it on soc-core.
But, I can't test for all boards/platforms, thus,
I added [RFC] for these patches.

Now, we are still missing CPU part, but can use it for Codec/Platform.
These patches use it on simple/audio cards for Codec/Platform.
If these are OK, and if we could have CPU support in the future,
we can convert current legacy style to snd_soc_dai_link_component style
for all sound cards.

 1) -  8) use snd_soc_dai_link_component for Codec    on simple/audio card
 9) - 15) use snd_soc_dai_link_component for Platform on simple/audio card

Kuninori Morimoto (15):
   1) ASoC: simple_card_utils: support snd_soc_dai_link_component style for codec
   2) ASoC: simple-card: support snd_soc_dai_link_component style for codec
   3) ASoC: simple-scu-card: use simple_dai_props
   4) ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec
   5) ASoC: audio-graph-card: support snd_soc_dai_link_component style for codec
   6) ASoC: audio-graph-scu-card: use simple_dai_props
   7) ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec
   8) ASoC: simple-card-util: remove dai_link compatible code for codec
   9) ASoC: soc-core: use snd_soc_dai_link_component for platform
  10) ASoC: simple-card-util: support snd_soc_dai_link_component style for platform
  11) ASoC: simple-card: support snd_soc_dai_link_component style for platform
  12) ASoC: simple-scu-card: support snd_soc_dai_link_component style for platform
  13) ASoC: audio-graph-card: support snd_soc_dai_link_component style for platform
  14) ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for platform
  15) ASoC: simple-card-util: remove dai_link compatible code for platform

 include/sound/simple_card_utils.h        | 27 ++++++++++------
 include/sound/soc.h                      |  2 ++
 sound/soc/generic/audio-graph-card.c     | 18 +++++++++--
 sound/soc/generic/audio-graph-scu-card.c | 55 +++++++++++++++++++++-----------
 sound/soc/generic/simple-card-utils.c    | 47 ++++++++++++++++++++++++---
 sound/soc/generic/simple-card.c          | 30 ++++++++++++++---
 sound/soc/generic/simple-scu-card.c      | 54 ++++++++++++++++++++-----------
 sound/soc/soc-core.c                     | 48 ++++++++++++++++++++++++----
 8 files changed, 217 insertions(+), 64 deletions(-)

--
2.7.4

Comments

Kuninori Morimoto Aug. 21, 2018, 6:47 a.m. UTC | #1
Hi Mark

I noticed that there are 1 small bug.
It is not a big deal, but I want to fixup.
Please let me know if v1 looks OK,
then, I will post v2 patch.
If v1 is not OK, then, I don't post v2.

> I think ALSA SoC framework needs more update for modern style
> As 1st step, codec/plaform are updated/converted to component style.
> I think 2nd step is DAI/dai_link matching.
> We want to use snd_soc_dai_link_component style instead of
> legacy style for dai_link matching for CPU/Codec/Platform.
> like this.
> 
> 	[current]
> 	struct snd_soc_dai_link {
> 		...
> 		*cpu_name;
> 		*cpu_of_node;
> 		*cpu_dai_name;
> 
> 		*codec_name;
> 		*codec_of_node;
> 		*codec_dai_name;
> 		*codecs;
> 		num_codecs;
> 
> 		*platform_name;
> 		*platform_of_node;
> 		...
> 	}
> 
> 	[we want]
> 	struct snd_soc_dai_link {
> 		...
> 		*cpus
> 		num_cpus;
> 
> 		*codecs;
> 		num_codecs;
> 
> 		*platform;
> 		...
> 	}
> 
> Above sample is still using CPU/Codec/Platform.
> We can merge it into same snd_soc_dai_link_component list
> if someone wants it. But anyway, CPU/Codec/Platform style
> is not so bad, so far.
> 
> It will be more useful/simple code if we can use
> snd_soc_dai_link_component for DAI instead of
> xxx_name / xxx_of_node / xxx_dai_name.
> 
> Currently, only Codec is supporting/using snd_soc_dai_link_component
> style. But we want to use it for CPU/Platform, too.
> I know Shreyas is posting multi CPU style, then, it can support
> snd_soc_dai_link_component style.
> 
> Using snd_soc_dai_link_component style for Platform is not difficult
> I think. [09/15] patch add it on soc-core.
> But, I can't test for all boards/platforms, thus,
> I added [RFC] for these patches.
> 
> Now, we are still missing CPU part, but can use it for Codec/Platform.
> These patches use it on simple/audio cards for Codec/Platform.
> If these are OK, and if we could have CPU support in the future,
> we can convert current legacy style to snd_soc_dai_link_component style
> for all sound cards.
> 
>  1) -  8) use snd_soc_dai_link_component for Codec    on simple/audio card
>  9) - 15) use snd_soc_dai_link_component for Platform on simple/audio card
> 
> Kuninori Morimoto (15):
>    1) ASoC: simple_card_utils: support snd_soc_dai_link_component style for codec
>    2) ASoC: simple-card: support snd_soc_dai_link_component style for codec
>    3) ASoC: simple-scu-card: use simple_dai_props
>    4) ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec
>    5) ASoC: audio-graph-card: support snd_soc_dai_link_component style for codec
>    6) ASoC: audio-graph-scu-card: use simple_dai_props
>    7) ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec
>    8) ASoC: simple-card-util: remove dai_link compatible code for codec
>    9) ASoC: soc-core: use snd_soc_dai_link_component for platform
>   10) ASoC: simple-card-util: support snd_soc_dai_link_component style for platform
>   11) ASoC: simple-card: support snd_soc_dai_link_component style for platform
>   12) ASoC: simple-scu-card: support snd_soc_dai_link_component style for platform
>   13) ASoC: audio-graph-card: support snd_soc_dai_link_component style for platform
>   14) ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for platform
>   15) ASoC: simple-card-util: remove dai_link compatible code for platform
> 
>  include/sound/simple_card_utils.h        | 27 ++++++++++------
>  include/sound/soc.h                      |  2 ++
>  sound/soc/generic/audio-graph-card.c     | 18 +++++++++--
>  sound/soc/generic/audio-graph-scu-card.c | 55 +++++++++++++++++++++-----------
>  sound/soc/generic/simple-card-utils.c    | 47 ++++++++++++++++++++++++---
>  sound/soc/generic/simple-card.c          | 30 ++++++++++++++---
>  sound/soc/generic/simple-scu-card.c      | 54 ++++++++++++++++++++-----------
>  sound/soc/soc-core.c                     | 48 ++++++++++++++++++++++++----
>  8 files changed, 217 insertions(+), 64 deletions(-)
> 
> --
> 2.7.4
>
Mark Brown Aug. 30, 2018, 2:12 p.m. UTC | #2
On Tue, Aug 21, 2018 at 06:47:48AM +0000, Kuninori Morimoto wrote:

> Please let me know if v1 looks OK,
> then, I will post v2 patch.

This looks like it moves everything in a more consistent direction so I
think it should be fine.
Kuninori Morimoto Aug. 31, 2018, 12:22 a.m. UTC | #3
Hi Mark

> > Please let me know if v1 looks OK,
> > then, I will post v2 patch.
> 
> This looks like it moves everything in a more consistent direction so I
> think it should be fine.

Thanks
I will post v2 patch