Re: [PATCH 0/4] ASoC: Add support for GPIOs driven amplifiers

From: Herve Codina

Date: Mon Mar 30 2026 - 12:43:34 EST


On Mon, 30 Mar 2026 16:48:54 +0100
Mark Brown <broonie@xxxxxxxxxx> wrote:

> On Mon, Mar 30, 2026 at 05:39:44PM +0200, Herve Codina wrote:
> > Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> > > This sounds a lot like simple-amplifier.c?
>
> > The gpio driven amplifier proposed is more generic and can handle
> > more complex design. I.e. op-amp + resistor and/or line (mute,
> > bypass) switching. Hardwares handled by this driver are a superset
> > of just dio2125 and so simple-amplifier.c.
>
> > IMHO, it makes sense to have a specific driver for those kind
> > of hardware design.
>
> Right, and if it's a superset it feels like it should all be one driver
> rather than two separate ones.

Also, it is worth noting that simple-amplifier.c considered a stereo
amplifier (left + right).

Considering the two op-amp available in dio2125 as just two op-amp used
in two separated mono channel with additional component to switch related
to resistors (independant switching for each channel) means that almost
everything proposed in audio-gpio-amp have to be duplicated (gain, mute,
bypass per channel) instead of just instantiate two audio-gpio-amps.

On the other hand, there is no reason to handle a stereo component in
audio-gpio-amp. Further more with the hardware I have handling a stereo
component doesn't make sense. Indeed, I only have independent mono lines
with their own resistor switched amplification circuitry.

I could merge everything in one .c file but only a few part of source code
will be common to simple-amplifier and audio-gpio-amp. IMHO the resulting
merged code will look like two different drivers merged in one .c file.

Best regards,
Hervé