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

From: Conor Dooley

Date: Fri Mar 13 2026 - 13:20:27 EST


On Fri, Mar 13, 2026 at 03:02: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. While it provides multiple functions, its
> primary hardware purpose is pin/switch control. To accurately represent
> the hardware as a single physical integrated circuit without unnecessary
> DT overhead, all functions are flattened into a single pinctrl node:
> - pinctrl: Exposing the 22 switch inputs (SG/SP pins) as a GPIO controller
> and managing their pin configurations.
> - hwmon: Exposing critical hardware faults (OT, OV, UV) and static
> voltage/temperature thresholds.
> - mux: 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>

>> .../bindings/pinctrl/nxp,mc33978.yaml | 148 ++++++++++++++++++
> 1 file changed, 148 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,mc33978.yaml
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/nxp,mc33978.yaml b/Documentation/devicetree/bindings/pinctrl/nxp,mc33978.yaml
> new file mode 100644
> index 000000000000..58a641a7c615
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/nxp,mc33978.yaml
> @@ -0,0 +1,148 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pinctrl/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.
> +
> + 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.
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> + compatible:
> + enum:
> + - nxp,mc33978
> + - nxp,mc34978

What's different about these that a fallback is not suitable?

> +
> + 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
> +
> + gpio-controller: true
> +
> + '#gpio-cells':
> + const: 2
> +
> + ngpios:
> + const: 22
> +
> +patternProperties:
> + '^.*-grp$':
> + type: object
> + $ref: /schemas/pinctrl/pincfg-node.yaml#
> + additionalProperties: false
> + description: Pin configuration subnodes.
> + properties:
> + pins: true

This seems overly permissive, think it should only allow the couple of
options that your hardware has. Probably just make it an enum? Shouldn't
have to check the driver to know what the acceptable pin names are.

Cheers,
Conor.

pw-bot: changes-requested

Attachment: signature.asc
Description: PGP signature