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

From: Linus Walleij

Date: Thu Mar 05 2026 - 07:58:25 EST


On Wed, Mar 4, 2026 at 1:18 PM David Jander <david@xxxxxxxxxxx> wrote:

> > OK, thanks for the explanation, but then primary function is not GPIO
> > either, because nothing on linked page says it is a generic purpose IO.
> > It says it is switch detection. Maybe better generic name is then
> > "pinctrl", thus also "pinctrl" child should be folded into the parent...
> > but switch detection is also not a pinctrl. :/
>
> I agree. This chip is indeed not very clear-cut with respect to the correct
> Linux subsystem. It could also be an input device if you view it strictly from
> the "switches" standpoint. I thought about this also, but figured that it
> would be more flexible to just view it as a pinctrl device, which could always
> be used in combination with something like gpio-keys.c if one really wanted
> the input functionality. For context, our use-case is primarily for industrial
> control reading digital sensors such as mechanical switches or industrial
> optical sensors, and that is AFAIK the main application for this chip anyway.
> For this the gpio UAPI is a good match.

I have read the datasheets and GPIO+pinctrl is the best fit in my opinion,
mostly because there are a lot of electric properties involved and there
are industrial use cases, which is a good fit for the GPIO character
device and the pinctrl+GPIO generic pin config options, some which
are already identical.

The alternative would be to create something new in drivers/iio
which I think is overkill.

Yours,
Linus Walleij