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

From: Krzysztof Kozlowski

Date: Wed Mar 04 2026 - 02:59:54 EST


On Tue, Mar 03, 2026 at 02:39:41PM +0100, Oleksij Rempel wrote:
> + '#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
> +
> +patternProperties:
> + "^pinctrl(@.*)?":

Drop @ part. Your binding does not allow addressing anyway.

> + type: object
> + $ref: /schemas/pinctrl/nxp,mc33978-pinctrl.yaml#
> + description:
> + Pinctrl and GPIO controller child node for the 22 switch inputs.
> +
> +required:
> + - compatible
> + - interrupt-controller
> + - '#interrupt-cells'
> + - interrupts
> + - reg

Odd order. Keep the same as in the list of properties.

> + - vbatp-supply
> + - vddq-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 = <&reg_3v3>;
> + vbatp-supply = <&reg_12v>;
> +
> + #mux-control-cells = <0>;
> +
> + pinctrl {
> + compatible = "nxp,mc33978-pinctrl";
> + gpio-controller;
> + #gpio-cells = <2>;
> + };
> +

Stray blank line

> + };
> + };
> 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..f8257d55d466
> --- /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
> +
> +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
> +
> + gpio-controller: true
> +
> + '#gpio-cells':
> + const: 2
> +
> + ngpios:
> + const: 22
> +
> +patternProperties:
> + "^.*-grp$":
> + type: object
> + $ref: pincfg-node.yaml#
> + additionalProperties: false
> + description:
> + Pin configuration subnodes.
> + properties:
> + pins: true
> + bias-pull-up: true
> + bias-pull-down: true
> + bias-high-impedance: true
> +
> +required:
> + - compatible
> + - gpio-controller
> + - '#gpio-cells'
> +
> +unevaluatedProperties: false

additionalProperties instead

> +
> +examples:
> + - |
> + pinctrl {
> + compatible = "nxp,mc33978-pinctrl";
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpios = <22>;
> +
> + door-grp {
> + pins = "sg0";
> + bias-high-impedance;
> + };
> + };
> --
> 2.47.3
>