Re: [PATCH v2 1/6] dt-bindings: mfd: add NXP MC33978/MC34978 MSDI

From: David Jander

Date: Fri Mar 06 2026 - 03:44:22 EST


On Fri, 6 Mar 2026 00:40:16 +0100
Linus Walleij <linusw@xxxxxxxxxx> wrote:

> On Thu, Mar 5, 2026 at 4:10 PM David Jander <david@xxxxxxxxxxx> wrote:
>
> > I am tempted to think that hardware developers that use this chip might expect
> > the GPIO driver to report the state as it is read from the register. But I
> > suspect that the Linux kernel GPIO framework might enforce strictly the
> > logical state to be equal to the voltage at the pin (i.e. logic 0 == zero volt,
> > and logic 1 == positive non-zero voltage), but is this true?
>
> GPIO assumes all values are expressing the (raw) voltage on the pin
> clamped to [0,1] logic level.

This sounds like a good, usable definition. I like it, but I can't find it in
the documentation. To make it more complete, I'd add one more clarification in
case we deal with negative voltage levels (0 and -5V for example), but it is
usable for this case. Where can I find it? Or.. should we add it to the
documentation if it isn't documented this way yet?

> It can further invert the meaning of this using GPIO_ACTIVE_LOW,
> ACTIVE LOW means the same as "overstrike" or #VAL in schematic
> so if a signal is active low and low voltage on the board it is
> presented as active (1) to the consumers in the kernel or
> userspace.
>
> If it represents anything else than the raw logic voltage on the line,
> the semantics of GPIO_ACTIVE_LOW would be completely
> confusing.
>
> To represent switch states, I think using drivers or userspace code
> should interpret this.
>
> You can also add a custom debugfs file to your driver to help
> users by providing the actual switch state and more.

Thanks for clarifying. This makes sense taking into account the above
definition of raw logic-level == raw voltage on pin clamped to [0,1].
But for the future users of this driver I would need this officially defined
somewhere, so I can point there to avoid confusion.

Best regards,

--
David Jander