[alsa-devel] [SAMPLE-PATCH 0/x] ASoC: replace snd_soc_read/write

Lars-Peter Clausen lars at metafoo.de
Wed Oct 19 10:39:56 CEST 2016


On 10/19/2016 10:19 AM, Kuninori Morimoto wrote:
> 
> Hi Lars
> 
>> The problematic bits are in the ASoC core where we have code that needs to
>> know whether a component is a CODEC or not. These are the issue we need to
>> resolve before we can think about converting more driver snd_soc_codec to
>> snd_soc_component.
> 
> Yeah, I agree about this, but
> 
>> I agree with Takashi, in my opinion this is not the right change at this
>> point in time. snd_soc_{write,read}() are not problematic they are simple
>> wrapper functions around snd_soc_component_{write,read}() that make it more
>> convenient to use them in a CODEC driver. Same for the CODEC specific
>> probe()/remove() callbacks.
>>
>> And while we are phasing out the concept of differentiating between
>> different types of components, since the hardware landscape has changed so
>> that there is no longer a really meaningful differentiating factor,
>> snd_soc_codec and snd_soc_codec drivers will still be around for a while.
> (snip)
>> Doing these partial conversions only leaves us with a lot of drivers that
>> are more convoluted than they need to be. In my opinion a driver should be
>> converted in one go, making it a complete component driver. But not leave it
>> partially component and partially CODEC. We've done this for the drivers
>> where it is possible, e.g. see [1].
> 
> Your "converted in one go" includes many conversion in 1 patch, right ?
> But it will be difficult to review, and is big risk.
> 
> I talked this topic with Mark in Berlin, and if my understand was correct,
> he agreed about step-by-step approach, because current driver is very complex.
> many conversion in 1 patch x 100 driver is very big risk IMO.

It does not have to be in one patch, but it should be in one series. A patch
series should result in a overall improvement of the code. Just changing
snd_soc_read() to snd_soc_component_read() does not improve the code, it
makes it slightly worse since as you can see from the diffstat of your
patches it requires more boilerplate code.

So such a change needs to be paired with other changes so that the overall
result of the patch series is a improvement.

You said in your earlier mail "and 3rd, 4th... I don't know how many steps
are exist.". We need to figure those steps out before we start converting a
driver, otherwise we'll be left with lots of frankenstein drivers that are
part snd_soc_component, part snd_soc_codec.


More information about the Alsa-devel mailing list