Re: [PATCH 2/7] ASoC: codec: tlv320aic32x4: Convert to GPIO descriptors
From: Linus Walleij
Date: Wed Apr 16 2025 - 07:10:51 EST
On Tue, Apr 15, 2025 at 3:53 PM Alexander Stein
<alexander.stein@xxxxxxxxxxxxxxx> wrote:
> > + /* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
>
> As stated above this comment shouldn't be necessary, it might be even
> confusing if there is some external inverter to the GPIO.
I have added comments like this to many patches due to spurious comments
from developers who were not aware that gpiolib handles polarity inversion
and are confused when we set the value to "1" to reset an active low reset
line.
At some point I wanted to define something like
#define GPIO_ASSERTED 1
#define GPIO_UNASSERTED 0
And use these defines to make it absolutely clear what is going on...
But I didn't get around to.
Yours,
Linus Walleij