From: Frank Li <Frank.li@oss.nxp.com>
To: vjardin@free.fr
Cc: Dong Aisheng <aisheng.dong@nxp.com>,
Fabio Estevam <festevam@gmail.com>, Frank Li <Frank.Li@nxp.com>,
Jacky Bai <ping.bai@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
NXP S32 Linux Team <s32@nxp.com>,
Linus Walleij <linusw@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH v3 4/5] pinctrl: freescale: add the LX2160A RCW pad-mux driver
Date: Fri, 13 Nov 2026 15:21:54 -0600 [thread overview]
Message-ID: <avd_cinZZIXWZ5rZ@SMW015318> (raw)
In-Reply-To: <20261108-for-upstream-lx2160a-rcw-pinmux-v1-v3-4-5a0063f1da9e@free.fr>
On Sun, Nov 08, 2026 at 11:06:52AM +0100, Vincent Jardin via B4 Relay wrote:
> From: Vincent Jardin <vjardin@free.fr>
>
> The LX2160A muxes its IIC, XSPI, SDHC, UART, IRQ and EVT pads from
> fields of the RCW, read-only in RCWSR12..14 of DCFG and changed at
> runtime through the same fields of the override registers in its DCSR
> view, which read 0 until written.
>
> Since commit 8a1365c7bbc1 ("arm64: dts: lx2160a: add pinmux and i2c
> gpio to support bus recovery") Linux drives them with pinctrl-single on
> the override registers, so its first pin state clears every other field
> of the word: a board whose RCW programs a non-zero pad mux loses those
> pads at the first I2C probe.
>
> Add a driver for the pad mux as a child of the DCFG node: the fields
> of RCWSR12..14 and their encoding.
> Then pin states select them with the generic function and groups
> properties, and every change goes through the RCW override
> of fsl-guts, which reads the status register, writes the override and
> waits for the status register to follow.
>
> Signed-off-by: Vincent Jardin <vjardin@free.fr>
> ---
> MAINTAINERS | 7 +
> drivers/pinctrl/freescale/Kconfig | 15 ++
> drivers/pinctrl/freescale/Makefile | 1 +
> drivers/pinctrl/freescale/pinctrl-lx2160a.c | 355 ++++++++++++++++++++++++++++
> 4 files changed, 378 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 93abbb315065..6c488605f5da 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -20207,6 +20207,13 @@ F: Documentation/devicetree/bindings/clock/*imx*
> F: drivers/clk/imx/
> F: include/dt-bindings/clock/*imx*
>
> +NXP LX2160A RCW PAD-MUX DRIVER
> +M: Vincent Jardin <vjardin@free.fr>
> +L: linux-gpio@vger.kernel.org
Add imx@lists.linux.dev
> +S: Maintained
> +F: Documentation/devicetree/bindings/pinctrl/fsl,lx2160a-rcw-pinmux.yaml
> +F: drivers/pinctrl/freescale/pinctrl-lx2160a.c
> +
> NXP NETC ETHERNET SWITCH DRIVER
> M: Wei Fang <wei.fang@nxp.com>
> R: Clark Wang <xiaoning.wang@nxp.com>
> diff --git a/drivers/pinctrl/freescale/Kconfig b/drivers/pinctrl/freescale/Kconfig
> index fd53cf5bb843..a3222714c970 100644
> --- a/drivers/pinctrl/freescale/Kconfig
> +++ b/drivers/pinctrl/freescale/Kconfig
> @@ -283,3 +283,18 @@ config PINCTRL_IMXRT1170
> select PINCTRL_IMX
> help
> Say Y here to enable the imxrt1170 pinctrl driver
> +
> +config PINCTRL_LX2160A
> + bool "NXP LX2160A RCW pad-mux driver"
> + depends on OF
> + depends on ARCH_LAYERSCAPE || COMPILE_TEST
> + default ARCH_LAYERSCAPE
> + select FSL_GUTS
> + select GENERIC_PINCTRL_GROUPS
> + select GENERIC_PINMUX_FUNCTIONS
> + select GENERIC_PINCONF
> + help
> + Say Y here to mux the IIC, XSPI, SDHC, UART, IRQ and EVT pads of the
> + LX2160A at runtime. The pads are muxed by fields of the RCW:
> + the driver changes it in the DCSR view of the DCFG that fsl-guts
> + drives, and is what the I2C bus recovery of the LX2160A needs.
> diff --git a/drivers/pinctrl/freescale/Makefile b/drivers/pinctrl/freescale/Makefile
> index d27085c2b4c4..5ec0d1710ad5 100644
> --- a/drivers/pinctrl/freescale/Makefile
> +++ b/drivers/pinctrl/freescale/Makefile
> @@ -35,3 +35,4 @@ obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o
> obj-$(CONFIG_PINCTRL_IMX28) += pinctrl-imx28.o
> obj-$(CONFIG_PINCTRL_IMXRT1050) += pinctrl-imxrt1050.o
> obj-$(CONFIG_PINCTRL_IMXRT1170) += pinctrl-imxrt1170.o
> +obj-$(CONFIG_PINCTRL_LX2160A) += pinctrl-lx2160a.o
> diff --git a/drivers/pinctrl/freescale/pinctrl-lx2160a.c b/drivers/pinctrl/freescale/pinctrl-lx2160a.c
> new file mode 100644
> index 000000000000..ba5bbcfab9fd
> --- /dev/null
> +++ b/drivers/pinctrl/freescale/pinctrl-lx2160a.c
> @@ -0,0 +1,355 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * LX2160A pad muxes: fields of the RCW, changed at
> + * runtime.
> + *
> + * Copyright 2026 Free Mobile - Vincent Jardin
> + */
> +
> +#include <linux/bits.h>
> +#include <linux/fsl/guts.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/pinctrl/pinconf-generic.h>
> +#include <linux/pinctrl/pinctrl.h>
> +#include <linux/pinctrl/pinmux.h>
> +#include <linux/platform_device.h>
> +#include <linux/seq_file.h>
> +
> +#include "../core.h"
> +#include "../pinmux.h"
> +
> +struct lx2160a_pmux_func {
> + const char *name;
> + u8 val;
> +};
> +
> +struct lx2160a_pmux_group {
> + const char *name;
> + u8 rcwsr; /* 12..14 */
> + u8 shift;
> + u8 width;
> + const struct lx2160a_pmux_func *funcs;
> + u8 nfuncs;
> +};
> +
> +#define FUNC(_name, _val) { .name = _name, .val = _val }
> +#define GROUP(_name, _rcwsr, _shift, _width, _funcs) \
The name is too common and short, easy happen name collision.
Frank
next prev parent reply other threads:[~2026-11-13 21:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 10:06 [PATCH v3 0/5] lx2160a: change the pad muxes through the RCW override Vincent Jardin via B4 Relay
2026-11-08 10:06 ` [PATCH v3 1/5] dt-bindings: pinctrl: add the NXP LX2160A RCW pad mux Vincent Jardin via B4 Relay
2026-11-13 14:43 ` Rob Herring (Arm)
2026-11-13 21:29 ` Frank Li
2026-11-08 10:06 ` [PATCH v3 2/5] dt-bindings: soc: fsl: layerscape-dcfg: add the LX2160A pad-mux child Vincent Jardin via B4 Relay
2026-11-13 14:43 ` Rob Herring (Arm)
2026-11-08 10:06 ` [PATCH v3 3/5] soc: fsl: guts: add the RCW override of any RCWSR Vincent Jardin via B4 Relay
2026-11-13 16:39 ` Vincent Jardin
2026-11-13 21:23 ` Frank Li
2026-11-13 21:24 ` Frank Li
2026-11-08 10:06 ` [PATCH v3 4/5] pinctrl: freescale: add the LX2160A RCW pad-mux driver Vincent Jardin via B4 Relay
2026-11-13 16:43 ` Vincent Jardin
2026-11-13 21:21 ` Frank Li [this message]
2026-11-08 10:06 ` [PATCH v3 5/5] arm64: dts: lx2160a: describe the pad muxes as the DCFG RCW override Vincent Jardin via B4 Relay
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=avd_cinZZIXWZ5rZ@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=chleroy@kernel.org \
--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=linuxppc-dev@lists.ozlabs.org \
--cc=ping.bai@nxp.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
--cc=vjardin@free.fr \
--cc=vladimir.oltean@nxp.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox