Re: [PATCH v3 1/7] dt-bindings: mfd: add NXP MC33978/MC34978 MSDI
From: Krzysztof Kozlowski
Date: Wed Mar 11 2026 - 02:54:11 EST
On Mon, Mar 09, 2026 at 02:49:12PM +0100, Oleksij Rempel wrote:
> Add device tree binding documentation for the NXP MC33978 and MC34978
> Multiple Switch Detection Interface (MSDI) devices.
>
> These ICs monitor up to 22 mechanical switch contacts in automotive and
> industrial environments. They provide configurable wetting currents to
> break through contact oxidation and feature extensive hardware
> protection against thermal overload and voltage transients (load
> dumps/brown-outs).
>
> The device interfaces via SPI and provides multiple functions. To
> accurately represent the hardware without unnecessary DT overhead, the
> binding is structured as follows:
> - pinctrl: A dedicated child node managing the 22 switch inputs (SG/SP
> pins) and their GPIO configurations.
> - hwmon: Integrated into the parent node, exposing critical hardware
> faults (OT, OV, UV) and static voltage/temperature thresholds.
> - mux: Integrated into the parent node, controlling the 24-to-1 analog
> multiplexer to route pin voltages, internal temperature, or battery
> voltage to an external SoC ADC.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> ---
> changes v3:
> - Drop regular expression pattern from pinctrl child node and define
> it as a standard property
> - Reorder required properties list in MFD binding
> - Remove stray blank line from the MFD binding devicetree example
> - Replace unevaluatedProperties with additionalProperties in the pinctrl
> binding
> changes v2:
> - Squashed MFD, pinctrl, hwmon, and mux bindings into a single patch
> - Removed the empty hwmon child node
> - Folded the mux-controller node into the parent MFD node
> - Added vbatp-supply and vddq-supply to the required properties block
> - Changed the example node name from mc33978@0 to gpio@0
> - Removed unnecessary literal block scalars (|) from descriptions
> - Documented SG, SP, and SB pin acronyms in the pinctrl description
> - Added consumer polarity guidance (GPIO_ACTIVE_LOW/HIGH) for SG/SB
> inputs, with a note on output circuit dependency
> - Updated commit message
> ---
> .../devicetree/bindings/mfd/nxp,mc33978.yaml | 112 ++++++++++++++++++
> .../bindings/pinctrl/nxp,mc33978-pinctrl.yaml | 82 +++++++++++++
> 2 files changed, 194 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mfd/nxp,mc33978.yaml
> create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,mc33978-pinctrl.yaml
>
> diff --git a/Documentation/devicetree/bindings/mfd/nxp,mc33978.yaml b/Documentation/devicetree/bindings/mfd/nxp,mc33978.yaml
> new file mode 100644
> index 000000000000..23520315d484
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/nxp,mc33978.yaml
> @@ -0,0 +1,112 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/nxp,mc33978.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP MC33978/MC34978 Multiple Switch Detection Interface
> +
> +maintainers:
> + - David Jander <david@xxxxxxxxxxx>
> + - Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> +
> +description:
> + The MC33978 and MC34978 are Multiple Switch Detection Interface (MSDI)
> + devices with 22 switch inputs, integrated fault detection, and analog
> + multiplexer (AMUX) for voltage/temperature monitoring.
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> + $nodename:
> + pattern: "^gpio(@.*)?$"
@.+, because it is not optional, or just drop the nodename completely.
> +
> + compatible:
> + enum:
> + - nxp,mc33978
> + - nxp,mc34978
> +
> + reg:
> + maxItems: 1
> + description: SPI chip select number
> +
> + spi-max-frequency:
> + maximum: 8000000
> + description: Maximum SPI clock frequency (up to 8 MHz)
> +
> + interrupts:
> + maxItems: 1
> + description:
> + INT_B pin interrupt. Active-low, indicates pin state changes or
> + fault conditions.
> +
> + interrupt-controller: true
> +
> + '#interrupt-cells':
> + const: 2
> + description:
> + First cell is the IRQ number (0-21 for pins, 22 for faults).
> + Second cell is the trigger type (IRQ_TYPE_* from interrupt-controller.h).
> +
> + '#mux-control-cells':
> + const: 0
> + description:
> + Present if the device AMUX selector is used as a mux provider.
> + Consumers (e.g. io-channel-mux) must provide settle-time-us for the
> + external ADC sampling path.
> +
> + vddq-supply:
> + description: Digital supply voltage
> +
> + vbatp-supply:
> + description: Battery/power supply
> +
> + pinctrl:
> + type: object
> + $ref: /schemas/pinctrl/nxp,mc33978-pinctrl.yaml#
> + description:
> + Pinctrl and GPIO controller child node for the 22 switch inputs.
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-controller
> + - '#interrupt-cells'
> + - vddq-supply
> + - vbatp-supply
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/gpio/gpio.h>
> +
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + msdi: gpio@0 {
> + compatible = "nxp,mc33978";
> + reg = <0>;
> + spi-max-frequency = <4000000>;
> +
> + interrupt-parent = <&gpiog>;
> + interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> +
> + vddq-supply = <®_3v3>;
> + vbatp-supply = <®_12v>;
> +
> + #mux-control-cells = <0>;
> +
> + pinctrl {
> + compatible = "nxp,mc33978-pinctrl";
> + gpio-controller;
> + #gpio-cells = <2>;
pin grp nodes should be here
> + };
> + };
> + };
> diff --git a/Documentation/devicetree/bindings/pinctrl/nxp,mc33978-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/nxp,mc33978-pinctrl.yaml
> new file mode 100644
> index 000000000000..ba946906557c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/nxp,mc33978-pinctrl.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pinctrl/nxp,mc33978-pinctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP MC33978/MC34978 Pinctrl/GPIO Driver
s/Driver// because otherwise it sounds like "pinctrl driver" and you
cannot drive pin controls.
> +
> +maintainers:
> + - David Jander <david@xxxxxxxxxxx>
> + - Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> +
> +description: |
> + Pin control and GPIO driver for the MC33978/MC34978 MSDI device.
> +
> + Pin numbering:
> + - Pins 0-13: SG0-SG13 (Switch-to-Ground inputs). These pins monitor
> + contacts closed to ground and typically require GPIO_ACTIVE_LOW
> + flags when used as digital inputs.
> + - Pins 14-21: SP0-SP7 (Programmable inputs). These can be configured
> + as SG (Switch-to-Ground) or SB (Switch-to-Battery) inputs. SB
> + inputs monitor contacts closed to the battery voltage and typically
> + require GPIO_ACTIVE_HIGH flags when used as digital inputs.
> +
> + Output Emulation:
> + The hardware lacks standard push-pull output drivers. Outputs are emulated
> + by toggling the programmable wetting current sources (acting as pull-ups or
> + pull-downs) and the hardware tri-state registers. Because of this physical
> + constraint:
> + - Consumers using pins as outputs MUST flag them with GPIO_OPEN_DRAIN or
> + GPIO_OPEN_SOURCE in the device tree.
> + - Push-pull configurations are physically unsupported.
> + - The active polarity depends entirely on the external circuit (e.g., how an
> + LED is wired) and must be flagged accordingly by the consumer.
> +
> +properties:
> + compatible:
> + enum:
> + - nxp,mc33978-pinctrl
> + - nxp,mc34978-pinctrl
I did not raise it before, but now I think these compatibles are
pointless. MC33978 is a one, specific (as in fixed) device, so its
pinctrl/gpio part won't be taken and used in some other device. They
should be dropped. That way entire schema would fit parent one, although
its placement is odd - it's not really MFD device.
> +
> + gpio-controller: true
> +
> + '#gpio-cells':
> + const: 2
> +
> + ngpios:
> + const: 22
> +
> +patternProperties:
> + "^.*-grp$":
Keep consistent quotes, either ' or "
Best regards,
Krzysztof