public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] pinctrl: Add generic pinctrl for board-level mux chips
@ 2026-02-19 22:23 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
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Frank Li @ 2026-02-19 22:23 UTC (permalink / raw)
  To: Peter Rosin, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafał Miłecki, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-kernel, linux-gpio, devicetree, imx, linux-arm-kernel,
	Frank Li

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

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Frank Li (5):
      mux: add devm_mux_control_get_from_np() to get mux from child node
      dt-bindings: pinctrl: Add generic pinctrl for board-level mux chips
      pinctrl: add generic board-level pinctrl driver using mux framework
      arm64: dts: imx8mp-evk: add board-level mux for CAN2 and MICFIL
      arm64: dts: imx8mp-evk: add flexcan2 overlay file

 .../bindings/pinctrl/pinctrl-multiplexer.yaml      |  54 +++++
 .../devicetree/bindings/pinctrl/pinctrl.yaml       |   2 +-
 arch/arm64/boot/dts/freescale/Makefile             |   4 +
 .../boot/dts/freescale/imx8mp-evk-flexcan2.dtso    |  15 ++
 arch/arm64/boot/dts/freescale/imx8mp-evk.dts       |  23 ++-
 drivers/mux/core.c                                 |  40 ++--
 drivers/pinctrl/Kconfig                            |   9 +
 drivers/pinctrl/Makefile                           |   1 +
 drivers/pinctrl/pinctrl-generic-mux.c              | 222 +++++++++++++++++++++
 include/linux/mux/consumer.h                       |  16 +-
 10 files changed, 363 insertions(+), 23 deletions(-)
---
base-commit: ff76d257e86235eb07ef33db8644a517c48d1c3f
change-id: 20260213-pinctrl-mux-df9c5b661540

Best regards,
--
Frank Li <Frank.Li@nxp.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-02-23 18:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox