Re: [PATCH v1 3/8] dt-bindings: pinctrl: add NXP MC33978/MC34978 pinctrl
From: Linus Walleij
Date: Fri Feb 27 2026 - 09:22:15 EST
On Fri, Feb 27, 2026 at 11:41 AM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> On Fri, Feb 27, 2026 at 12:02:53AM +0100, Linus Walleij wrote:
> > On Fri, Feb 27, 2026 at 12:00 AM Linus Walleij <linusw@xxxxxxxxxx> wrote:
> > > On Wed, Feb 25, 2026 at 6:16 PM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> >
> > > > + - Pins 14-21: SP0-SP7 (Programmable inputs, can be SG or SB)
> > >
> > > What is SB now? Please explain :)
>
> > Oh I see in the driver that this is Switch-to-battery. So document that here
> > in the bindings too.
> >
> > Also it seems that something configured as switch-to-batter must be
> > flagged GPIO_ACTIVE_HIGH.
>
> Actually, the active polarity depends entirely on the external circuit,
> especially since these pins can also be used as controllable current
> outputs.
>
> For example, we attach LEDs directly to the pins. If an LED is
> attached to an SG pin (or an SP pin operating in SG mode), the pin sinks
> current to ground to turn the LED on, making it GPIO_ACTIVE_HIGH from
> the LED consumer's perspective.
Aha OK I see.
My main input to the bindings and the driver design is a second pass
at polarity handling and how consumers in the device tree should
be flagged with GPIO_ACTIVE_LOW and/or GPIO_OPEN_DRAIN
and similar settings and how the Operating System (any operating
system) is supposed to react to that.
My main concern is the semantics with these flags.
Yours,
Linus Walleij