All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
Cc: "Peter Rosin" <peda@axentia.se>,
	"Linus Walleij" <linusw@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/5] dt-bindings: pinctrl: Add generic pinctrl for board-level mux chips
Date: Mon, 23 Feb 2026 12:42:52 -0600	[thread overview]
Message-ID: <20260223184252.GA132202-robh@kernel.org> (raw)
In-Reply-To: <20260219-pinctrl-mux-v1-2-678d21637788@nxp.com>

On Thu, Feb 19, 2026 at 05:23:42PM -0500, Frank Li wrote:
> Add a generic pinctrl binding for board-level pinmux chips that are
> controlled through the multiplexer subsystem.
> 
> On some boards, especially development boards, external mux chips are used
> to switch SoC signals between different peripherals (e.g. MMC and UART).
> The mux select lines are often driven by a GPIO expander over I2C,
> as illustrated below:
> 
> 	┌──────┐      ┌─────┐
> 	│ SOC  │      │     │    ┌───────┐
> 	│      │      │     │───►│ MMC   │
> 	│      │      │ MUX │    └───────┘
> 	│      ├─────►│     │    ┌───────┐
> 	│      │      │     │───►│ UART  │
> 	│      │      └─────┘    └───────┘
> 	│      │         ▲
> 	│      │    ┌────┴──────────────┐
> 	│ I2C  ├───►│ GPIO Expander     │
> 	└──────┘    └───────────────────┘
> 
> Traditionally, gpio-hog is used to configure the onboard mux at boot.
> However, the GPIO expander may probe later than consumer devices such as
> MMC. As a result, the MUX might not be configured when the peripheral
> driver probes, leading to initialization failures or data transfer errors.
> 
> Introduce a generic pinctrl binding that models the board-level MUX as a
> pin control provider and builds proper device links between the MUX, its
> GPIO controller, and peripheral devices. This ensures correct probe
> ordering and reliable mux configuration.
> 
> The implementation leverages the standard multiplexer subsystem, which
> provides broad support for onboard mux controllers and avoids the need for
> per-driver custom MUX handling.

Seems reasonable to me.

> 
> Allow pinctrl-* pattern as node name because this pinctrl device have not
> reg property.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  .../bindings/pinctrl/pinctrl-multiplexer.yaml      | 54 ++++++++++++++++++++++
>  .../devicetree/bindings/pinctrl/pinctrl.yaml       |  2 +-
>  2 files changed, 55 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-multiplexer.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-multiplexer.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..31efffb3167cba724b1afe0d403a0dcae65582ee
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-multiplexer.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pinctrl/pinctrl-multiplexer.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic Pin Control Driver for Board-Level Mux Chips
> +
> +maintainers:
> +  - Frank Li <Frank.Li@nxp.com>
> +
> +description:
> +  This binding describes a generic pinctrl driver that controls on-board

Bindings don't describe drivers.

> +  pinmux chips using the multiplexer subsystem.
> +
> +properties:
> +  compatible:
> +    const: pinctrl-multiplexer
> +
> +patternProperties:
> +  '-grp$':
> +    type: object

       additionalProperties: false

The tools should have caught this, I'll have to check why not...

> +    properties:
> +      mux-states:
> +        maxItems: 1
> +
> +    required:
> +      - mux-states
> +
> +required:
> +  - compatible
> +
> +allOf:
> +  - $ref: pinctrl.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    pinctrl-mux {
> +        compatible = "pinctrl-multiplexer";
> +
> +        uart-grp {
> +            mux-states = <&mux 0>;
> +        };
> +
> +        spi-grp {
> +            mux-states = <&mux 1>;
> +        };
> +
> +        i2c-grp {
> +            mux-states = <&mux 2>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
> index 290438826c507ec6725f486d18cf686aa7c35e67..20176bf3074757de30f208e69b968a6bd6125273 100644
> --- a/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
> @@ -27,7 +27,7 @@ description: |
>  
>  properties:
>    $nodename:
> -    pattern: "^(pinctrl|pinmux)(@[0-9a-f]+)?$"
> +    pattern: "^(pinctrl|pinmux)(@[0-9a-f]+|-[a-z0-9]+)?$"
>  
>    "#pinctrl-cells":
>      description: >
> 
> -- 
> 2.43.0
> 

  reply	other threads:[~2026-02-23 18:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 22:23 [PATCH 0/5] pinctrl: Add generic pinctrl for board-level mux chips Frank Li
2026-02-19 22:23 ` [PATCH 1/5] mux: add devm_mux_control_get_from_np() to get mux from child node Frank Li
2026-02-19 22:23 ` [PATCH 2/5] dt-bindings: pinctrl: Add generic pinctrl for board-level mux chips Frank Li
2026-02-23 18:42   ` Rob Herring [this message]
2026-02-19 22:23 ` [PATCH 3/5] pinctrl: add generic board-level pinctrl driver using mux framework Frank Li
2026-02-20  8:50   ` Daniel Baluta
2026-02-20 15:54     ` Frank Li
2026-02-20 23:38   ` Peter Rosin
2026-02-19 22:23 ` [PATCH 4/5] arm64: dts: imx8mp-evk: add board-level mux for CAN2 and MICFIL Frank Li
2026-02-20  8:53   ` Daniel Baluta
2026-02-19 22:23 ` [PATCH 5/5] arm64: dts: imx8mp-evk: add flexcan2 overlay file Frank Li
2026-02-19 23:12 ` [PATCH 0/5] pinctrl: Add generic pinctrl for board-level mux chips Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260223184252.GA132202-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=rafal@milecki.pl \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.