All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH 000/127] ASoC: codec cleanup - codec probe/remove
Date: Thu, 11 Aug 2016 19:44:03 +0200	[thread overview]
Message-ID: <5a3d865f-087f-eab2-82d8-0477c2ca1400@metafoo.de> (raw)
In-Reply-To: <871t1wuntb.wl%kuninori.morimoto.gx@renesas.com>

On 08/11/2016 03:03 AM, Kuninori Morimoto wrote:
> 
> Hi Mark
> 
>> If something is only using the component interfaces except for things
>> like probe and remove then converting them to component interfaces makes
>> sense.  If it's still using CODEC interfaces for some bits then it's
>> less clear that this is a good idea.
>>
>>> But it seems your opinion is like this ?
>>>  - ASoC will care only "component" (same as my opinion)
>>>  - This "component" includes all features
>>>    (= Codec feature, CPU feature, Platform feature, etc)
>>
>> I think so, yes.  To me the goal is to avoid too much rigid
>> categorization of components so that we can handle devices that have
>> combinations of these features effectively without having to worry about
>> exactly what terminology we use to describe them.
> 
> Hmm... If my understand was correct, my concern is this.
> If we merged all (CPU/Codec/Platform/etc...) features into component,
> it will be big size, and almost all feature are not needed for almost all devices.
> And in the future, we will have new type of device which we never know yet today.
> In such case, more new feature (it is unnecessary for existing devices) will be
> added to component. Then it will be bigger and bigger and bigger...

I don't quite share this concern and would even say the opposite is true.
When ASoC was introduced the (embedded audio) world was a lot simpler. There
was a clear distinction between what a CODEC, what a CPU side component and
what a platform is. Each of them had distinct roles which were reflected in
the code base.

Over time the hardware landscape changed and the distinction feature wise
did become smaller between the different types of components. The CPU side
components started to take care of tasks that were previously only found in
CODECS and wise versa.

This lead to a lot of code duplication in ASoC since the same functionality
was now implemented multiple times. Is this where the original
componentization effort started. The goal of this effort was to introduce
the snd_soc_component struct as a common base for all types of components in
ASoC. This allowed us to remove a lot of duplicated code and also reduce
struct sizes by implementing a more strict hierarchy.

If you look at snd_soc_codec and snd_soc_platform today you'll see that most
of the additional fields in there are for supporting legacy features. These
will not be moved over into snd_soc_component but will be phased out over
time once there are no users anymore. If you look at the componetization
patches you'll see that as part of that process already a lot of fields that
were originally in these structs have been removed reducing the overall
memory consumption of ASoC.

There is no intention to make snd_soc_component bloated. If a new kind of
component gets introduced which as very distinct features that are not found
in other kinds of components we can introduce a new sub-struct of
snd_soc_component to model that type. But the current hardware trends are
going in a different direction, as silicon gets cheaper, individual
components cover a wider feature set and which features are used in a
particular instance are application and hardware design dependent.

> 
> My opinion is that "component" which will be base of new ASoC should keep simple and small.
> New "component" has "each connection", and "callback" for each necessary point,
> and very basic feature only (like format, channel, etc)
> And each device struct which is based on component can have detail information if it wants.
> But here, ASoC cares component only. If framework need to do something for detail
> things, it should be done by callback.

I fully agree with this. snd_soc_component should provide the basic feature
set that is required by all components.

> 
> This doesn't mean "categorization". Of course current CPU/Codec/Platform looks
> like one of them, but I would like to say it will be "helper".
> Current "Codec" specific operation can go to "codec struct" specific callback,
> and ASoC framework doesn't care about it, it just call generic callback.
> This means soc-core will have "component" related operation only,
> and new soc-codec.c will have codec related operation as callback, for example.
> 

Agreed again. But the change you were making in this patch series was
affecting the CODEC layer, not the component layer. The CODEC layer is a
layer that is abstracted on top of the component layer, but in this series
you were removing part of that abstraction.

>>> Anyway, I don't want to create new issue on ASoC.
>>> It seems we (or only me ?) still don't have cristal clear big-picture (?)
>>> If so, my previous patch-set might make new style switching difficult.
>>> Mark, because of this reasons, is it possible to remove my previous
>>> patch-set (= topic/codec-component) from your repository ?
>>> Incomplete big-patch-set will cause new trouble.
>>> I want to cleanup ASoC, but I want to do it under cristal clear agreement.
>>
>> I think that's a reasonable thing to do in general, I don't see a
>> particular need to revert it.  Like Lars said I probably wouldn't have
>> done it right now but you've done the work so I don't see any need to
>> revert it.
> 
> According to your (and Lars ?) idea, if component includes all features,
> then, current "codec" will be "component", and "platform" will be "component" too (?).
> If so, I think necessary patch in final stage is like this ?
> 
> 	- static struct snd_soc_codec_driver xxxx = {
> 	+ static struct snd_soc_component_driver xxxx = {

In the long run probably yes, with the distinction of particular features
happening at a different level. E.g. like I pointed out in one of the
earlier e-mails, one such layer could be the domain and bridge layer were a
component is subdivided into domains and bridges.

  parent reply	other threads:[~2016-08-11 17:44 UTC|newest]

Thread overview: 138+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09  4:52 [PATCH 000/127] ASoC: codec cleanup - codec probe/remove Kuninori Morimoto
2016-08-09  4:53 ` [PATCH 001/127] ASoC: use component probe/remove on tas5086 Kuninori Morimoto
2016-08-09  4:53 ` [PATCH 002/127] ASoC: use component probe/remove on pistachio-internal-dac Kuninori Morimoto
2016-08-09  4:54 ` [PATCH 003/127] ASoC: use component probe/remove on wm8985 Kuninori Morimoto
2016-08-09  4:54 ` [PATCH 004/127] ASoC: use component probe/remove on wm8978 Kuninori Morimoto
2016-08-09  4:55 ` [PATCH 005/127] ASoC: use component probe/remove on wm8974 Kuninori Morimoto
2016-08-09  4:55 ` [PATCH 006/127] ASoC: use component probe/remove on wm8962 Kuninori Morimoto
2016-08-09  4:55 ` [PATCH 025/127] ASoC: use component probe/remove on sta32x Kuninori Morimoto
2016-08-09  4:56 ` [PATCH 007/127] ASoC: use component probe/remove on wm8960 Kuninori Morimoto
2016-08-09  4:56 ` [PATCH 008/127] ASoC: use component probe/remove on wm8776 Kuninori Morimoto
2016-08-09  4:56 ` [PATCH 009/127] ASoC: use component probe/remove on wm8770 Kuninori Morimoto
2016-08-09  4:57 ` [PATCH 010/127] ASoC: use component probe/remove on wm8753 Kuninori Morimoto
2016-08-09  4:57 ` [PATCH 011/127] ASoC: use component probe/remove on wm8750 Kuninori Morimoto
2016-08-09  4:58 ` [PATCH 012/127] ASoC: use component probe/remove on wm8741 Kuninori Morimoto
2016-08-09  4:58 ` [PATCH 013/127] ASoC: use component probe/remove on wm8737 Kuninori Morimoto
2016-08-09  4:58 ` [PATCH 014/127] ASoC: use component probe/remove on wm8711 Kuninori Morimoto
2016-08-09  4:59 ` [PATCH 015/127] ASoC: use component probe/remove on wm8580 Kuninori Morimoto
2016-08-09  4:59 ` [PATCH 016/127] ASoC: use component probe/remove on wm8523 Kuninori Morimoto
2016-08-09  5:00 ` [PATCH 017/127] ASoC: use component probe/remove on wm8510 Kuninori Morimoto
2016-08-09  5:00 ` [PATCH 018/127] ASoC: use component probe/remove on tlv320aic3x Kuninori Morimoto
2016-08-09  5:00 ` [PATCH 019/127] ASoC: use component probe/remove on tlv320aic31xx Kuninori Morimoto
2016-08-09  5:01 ` [PATCH 020/127] ASoC: use component probe/remove on tlv320aic23 Kuninori Morimoto
2016-08-09  5:01 ` [PATCH 021/127] ASoC: use component probe/remove on tas5720 Kuninori Morimoto
2016-08-09  5:02 ` [PATCH 022/127] ASoC: use component probe/remove on tas2552 Kuninori Morimoto
2016-08-09  5:02 ` [PATCH 023/127] ASoC: use component probe/remove on sti-sas Kuninori Morimoto
2016-08-09  5:03 ` [PATCH 024/127] ASoC: use component probe/remove on sta350 Kuninori Morimoto
2016-08-09  5:04 ` [PATCH 026/127] ASoC: use component probe/remove on ssm2602 Kuninori Morimoto
2016-08-09  5:05 ` [PATCH 027/127] ASoC: use component probe/remove on sgtl5000 Kuninori Morimoto
2016-08-09  5:06 ` [PATCH 028/127] ASoC: use component probe/remove on rt5631 Kuninori Morimoto
2016-08-09  5:06 ` [PATCH 029/127] ASoC: use component probe/remove on rt5616 Kuninori Morimoto
2016-08-09  5:07 ` [PATCH 030/127] ASoC: use component probe/remove on inno_rk3036 Kuninori Morimoto
2016-08-09  5:07 ` [PATCH 031/127] ASoC: use component probe/remove on es8328 Kuninori Morimoto
2016-08-09  5:08 ` [PATCH 032/127] ASoC: use component probe/remove on cs53l30 Kuninori Morimoto
2016-08-09  5:08 ` [PATCH 033/127] ASoC: use component probe/remove on cs42xx8 Kuninori Morimoto
2016-08-09  5:08 ` [PATCH 034/127] ASoC: use component probe/remove on cs42l73 Kuninori Morimoto
2016-08-09  5:09 ` [PATCH 035/127] ASoC: use component probe/remove on cs42l56 Kuninori Morimoto
2016-08-09  5:09 ` [PATCH 036/127] ASoC: use component probe/remove on cs42l52 Kuninori Morimoto
2016-08-09  5:10 ` [PATCH 037/127] ASoC: use component probe/remove on cs42l51 Kuninori Morimoto
2016-08-09  5:10 ` [PATCH 038/127] ASoC: use component probe/remove on cs4271 Kuninori Morimoto
2016-08-09  5:11 ` [PATCH 039/127] ASoC: use component probe/remove on cs4270 Kuninori Morimoto
2016-08-09  5:12 ` [PATCH 040/127] ASoC: use component probe/remove on cs35l33 Kuninori Morimoto
2016-08-09  5:12 ` [PATCH 041/127] ASoC: use component probe/remove on alc5623 Kuninori Morimoto
2016-08-09  5:12 ` [PATCH 042/127] ASoC: use component probe/remove on ak5386 Kuninori Morimoto
2016-08-09  5:13 ` [PATCH 043/127] ASoC: use component probe/remove on ak4642 Kuninori Morimoto
2016-08-09  5:13 ` [PATCH 044/127] ASoC: use component probe/remove on ak4104 Kuninori Morimoto
2016-08-09  5:14 ` [PATCH 045/127] ASoC: use component probe/remove on adau1701 Kuninori Morimoto
2016-08-09  5:15 ` [PATCH 046/127] ASoC: use component probe/remove on ac97 Kuninori Morimoto
2016-08-09  5:15 ` [PATCH 047/127] ASoC: use component probe/remove on atmel-classd Kuninori Morimoto
2016-08-09  5:15 ` [PATCH 048/127] ASoC: use component probe/remove on atmel-pdmic Kuninori Morimoto
2016-08-09  5:16 ` [PATCH 049/127] ASoC: use component probe/remove on 88pm860x-codec Kuninori Morimoto
2016-08-09  5:16 ` [PATCH 050/127] ASoC: use component probe/remove on ab8500-codec Kuninori Morimoto
2016-08-09  5:17 ` [PATCH 051/127] ASoC: use component probe/remove on ad1836 Kuninori Morimoto
2016-08-09  5:17 ` [PATCH 052/127] ASoC: use component probe/remove on ad193x Kuninori Morimoto
2016-08-09  5:17 ` [PATCH 053/127] ASoC: use component probe/remove on ad1980 Kuninori Morimoto
2016-08-09  5:18 ` [PATCH 054/127] ASoC: use component probe/remove on adau1373 Kuninori Morimoto
2016-08-09  5:18 ` [PATCH 055/127] ASoC: use component probe/remove on adau1761 Kuninori Morimoto
2016-08-09  5:19 ` [PATCH 056/127] ASoC: use component probe/remove on adau1781 Kuninori Morimoto
2016-08-09  5:19 ` [PATCH 057/127] ASoC: use component probe/remove on adau1977 Kuninori Morimoto
2016-08-09  5:19 ` [PATCH 058/127] ASoC: use component probe/remove on adav80x Kuninori Morimoto
2016-08-09  5:20 ` [PATCH 059/127] ASoC: use component probe/remove on alc5632 Kuninori Morimoto
2016-08-09  5:21 ` [PATCH 060/127] ASoC: use component probe/remove on cs47l24 Kuninori Morimoto
2016-08-09  5:21 ` [PATCH 061/127] ASoC: use component probe/remove on cx20442 Kuninori Morimoto
2016-08-09  5:21 ` [PATCH 062/127] ASoC: use component probe/remove on da7210 Kuninori Morimoto
2016-08-09  5:22 ` [PATCH 063/127] ASoC: use component probe/remove on da7213 Kuninori Morimoto
2016-08-09  5:22 ` [PATCH 064/127] ASoC: use component probe/remove on wm9713 Kuninori Morimoto
2016-08-09  5:22 ` [PATCH 065/127] ASoC: use component probe/remove on wm9712 Kuninori Morimoto
2016-08-09  5:23 ` [PATCH 066/127] ASoC: use component probe/remove on wm9705 Kuninori Morimoto
2016-08-09  5:23 ` [PATCH 067/127] ASoC: use component probe/remove on wm9090 Kuninori Morimoto
2016-08-09  5:23 ` [PATCH 068/127] ASoC: use component probe/remove on wm9081 Kuninori Morimoto
2016-08-09  5:24 ` [PATCH 069/127] ASoC: use component probe/remove on wm8998 Kuninori Morimoto
2016-08-09  5:24 ` [PATCH 070/127] ASoC: use component probe/remove on wm8997 Kuninori Morimoto
2016-08-09  5:25 ` [PATCH 071/127] ASoC: use component probe/remove on wm8996 Kuninori Morimoto
2016-08-09  5:25 ` [PATCH 072/127] ASoC: use component probe/remove on wm8995 Kuninori Morimoto
2016-08-09  5:25 ` [PATCH 073/127] ASoC: use component probe/remove on wm8994 Kuninori Morimoto
2016-08-09  5:26 ` [PATCH 074/127] ASoC: use component probe/remove on wm8993 Kuninori Morimoto
2016-08-09  5:26 ` [PATCH 075/127] ASoC: use component probe/remove on wm8990 Kuninori Morimoto
2016-08-09  5:27 ` [PATCH 076/127] ASoC: use component probe/remove on wm8988 Kuninori Morimoto
2016-08-09  5:27 ` [PATCH 077/127] ASoC: use component probe/remove on wm8983 Kuninori Morimoto
2016-08-09  5:27 ` [PATCH 078/127] ASoC: use component probe/remove on wm8971 Kuninori Morimoto
2016-08-09  5:28 ` [PATCH 079/127] ASoC: use component probe/remove on wm8961 Kuninori Morimoto
2016-08-09  5:28 ` [PATCH 080/127] ASoC: use component probe/remove on wm8955 Kuninori Morimoto
2016-08-09  5:28 ` [PATCH 081/127] ASoC: use component probe/remove on wm8940 Kuninori Morimoto
2016-08-09  5:29 ` [PATCH 082/127] ASoC: use component probe/remove on wm8904 Kuninori Morimoto
2016-08-09  5:29 ` [PATCH 083/127] ASoC: use component probe/remove on wm8900 Kuninori Morimoto
2016-08-09  5:29 ` [PATCH 084/127] ASoC: use component probe/remove on wm8400 Kuninori Morimoto
2016-08-09  5:30 ` [PATCH 085/127] ASoC: use component probe/remove on wm8350 Kuninori Morimoto
2016-08-09  5:30 ` [PATCH 086/127] ASoC: use component probe/remove on wm5110 Kuninori Morimoto
2016-08-09  5:30 ` [PATCH 088/127] ASoC: use component probe/remove on wm5100 Kuninori Morimoto
2016-08-09  5:31 ` [PATCH 089/127] ASoC: use component probe/remove on wm2200 Kuninori Morimoto
2016-08-09  5:31 ` [PATCH 090/127] ASoC: use component probe/remove on wm2000 Kuninori Morimoto
2016-08-09  5:32 ` [PATCH 091/127] ASoC: use component probe/remove on wm0010 Kuninori Morimoto
2016-08-09  5:32 ` [PATCH 092/127] ASoC: use component probe/remove on wl1273 Kuninori Morimoto
2016-08-09  5:32 ` [PATCH 093/127] ASoC: use component probe/remove on uda1380 Kuninori Morimoto
2016-08-09  5:33 ` [PATCH 094/127] ASoC: use component probe/remove on uda134x Kuninori Morimoto
2016-08-09  5:33 ` [PATCH 095/127] ASoC: use component probe/remove on twl6040 Kuninori Morimoto
2016-08-09  5:34 ` [PATCH 096/127] ASoC: use component probe/remove on twl4030 Kuninori Morimoto
2016-08-09  5:34 ` [PATCH 097/127] ASoC: use component probe/remove on tlv320dac33 Kuninori Morimoto
2016-08-09  5:34 ` [PATCH 098/127] ASoC: use component probe/remove on tlv320aic32x4 Kuninori Morimoto
2016-08-09  5:35 ` [PATCH 099/127] ASoC: use component probe/remove on tlv320aic26 Kuninori Morimoto
2016-08-09  5:35 ` [PATCH 100/127] ASoC: use component probe/remove on stac9766 Kuninori Morimoto
2016-08-09  5:36 ` [PATCH 101/127] ASoC: use component probe/remove on sn95031 Kuninori Morimoto
2016-08-09  5:36 ` [PATCH 102/127] ASoC: use component probe/remove on rt5677 Kuninori Morimoto
2016-08-09  5:36 ` [PATCH 103/127] ASoC: use component probe/remove on rt5670 Kuninori Morimoto
2016-08-09  5:37 ` [PATCH 104/127] ASoC: use component probe/remove on rt5659 Kuninori Morimoto
2016-08-09  5:38 ` [PATCH 105/127] ASoC: use component probe/remove on rt5651 Kuninori Morimoto
2016-08-09  5:38 ` [PATCH 106/127] ASoC: use component probe/remove on rt5645 Kuninori Morimoto
2016-08-09  5:38 ` [PATCH 107/127] ASoC: use component probe/remove on rt5640 Kuninori Morimoto
2016-08-09  5:39 ` [PATCH 108/127] ASoC: use component probe/remove on rt5514 Kuninori Morimoto
2016-08-09  5:39 ` [PATCH 109/127] ASoC: use component probe/remove on rt298 Kuninori Morimoto
2016-08-09  5:40 ` [PATCH 110/127] ASoC: use component probe/remove on rt286 Kuninori Morimoto
2016-08-09  5:40 ` [PATCH 111/127] ASoC: use component probe/remove on nau8825 Kuninori Morimoto
2016-08-09  5:40 ` [PATCH 112/127] ASoC: use component probe/remove on ml26124 Kuninori Morimoto
2016-08-09  5:41 ` [PATCH 113/127] ASoC: use component probe/remove on mc13783 Kuninori Morimoto
2016-08-09  5:41 ` [PATCH 114/127] ASoC: use component probe/remove on max98926 Kuninori Morimoto
2016-08-09  5:41 ` [PATCH 115/127] ASoC: use component probe/remove on max98925 Kuninori Morimoto
2016-08-09  5:42 ` [PATCH 116/127] ASoC: use component probe/remove on max9867 Kuninori Morimoto
2016-08-09  5:42 ` [PATCH 117/127] ASoC: use component probe/remove on max9850 Kuninori Morimoto
2016-08-09  5:42 ` [PATCH 118/127] ASoC: use component probe/remove on max98357a Kuninori Morimoto
2016-08-09  5:43 ` [PATCH 119/127] ASoC: use component probe/remove on max98095 Kuninori Morimoto
2016-08-09  5:43 ` [PATCH 120/127] ASoC: use component probe/remove on max98090 Kuninori Morimoto
2016-08-09  5:43 ` [PATCH 121/127] ASoC: use component probe/remove on max98088 Kuninori Morimoto
2016-08-09  5:44 ` [PATCH 122/127] ASoC: use component probe/remove on jz4740 Kuninori Morimoto
2016-08-09  5:44 ` [PATCH 123/127] ASoC: use component probe/remove on hdac_hdmi Kuninori Morimoto
2016-08-09  5:44 ` [PATCH 124/127] ASoC: use component probe/remove on da9055 Kuninori Morimoto
2016-08-09  5:45 ` [PATCH 125/127] ASoC: use component probe/remove on da7219 Kuninori Morimoto
2016-08-09  5:45 ` [PATCH 126/127] ASoC: use component probe/remove on da7218 Kuninori Morimoto
2016-08-09  5:46 ` [PATCH 127/127] ASoC: remove codec duplicated .probe/.remove Kuninori Morimoto
2016-08-09  7:52 ` [PATCH 000/127] ASoC: codec cleanup - codec probe/remove Lars-Peter Clausen
2016-08-09 11:26   ` Mark Brown
2016-08-10  0:31     ` Kuninori Morimoto
2016-08-10 11:17       ` Mark Brown
2016-08-11  1:03         ` Kuninori Morimoto
2016-08-11 17:07           ` Mark Brown
2016-08-11 17:44           ` Lars-Peter Clausen [this message]
2016-08-12  1:27             ` Kuninori Morimoto
2016-08-12  9:33               ` Lars-Peter Clausen
2016-08-12 10:22                 ` Mark Brown
2016-08-22  2:15                 ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a3d865f-087f-eab2-82d8-0477c2ca1400@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.