Re: [PATCH v2 2/3] arm64: dts: imx952-frdm: model CAN/GPIO selector as gpio-mux

From: Bough Chen

Date: Sun Nov 22 2026 - 21:10:19 EST


On Fri, Nov 20, 2026 at 07:09:49PM +0800, Joy Zou wrote:
> Replace the gpio-hog used for CAN/GPIO selection with a gpio-mux
> controller and pinctrl-multiplexer states.
>
> The board provides a GPIO-controlled mux between CAN and GPIO.
> Describe it explicitly instead of relying on a fixed GPIO state.
>
> Signed-off-by: Joy Zou <joy.zou@xxxxxxxxxxx>

Reviewed-by: Haibo Chen <haibo.chen@xxxxxxx>

Regards
Haibo Chen
> ---
> Changes in v2:
> 1. add a new patch to replace gpio-hog with gpio-mux in preparation for
> i.MX937 code reuse.
> ---
> arch/arm64/boot/dts/freescale/imx952-frdm.dtsi | 28 ++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx952-frdm.dtsi b/arch/arm64/boot/dts/freescale/imx952-frdm.dtsi
> index 4d325e848aa8..88e77d6e9c45 100644
> --- a/arch/arm64/boot/dts/freescale/imx952-frdm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx952-frdm.dtsi
> @@ -39,6 +39,25 @@ bt_sco_codec: audio-codec-bt-sco {
> #sound-dai-cells = <1>;
> };
>
> + can_mux: mux-controller-0 {
> + compatible = "gpio-mux";
> + #mux-control-cells = <0>;
> + #mux-state-cells = <1>;
> + mux-gpios = <&pcal6416 4 GPIO_ACTIVE_HIGH>;
> + };
> +
> + can_mux_pinctrl: pinctrl-gpiomux {
> + compatible = "pinctrl-multiplexer";
> +
> + can2_fun: can-grp {
> + mux-states = <&can_mux 0>;
> + };
> +
> + gpio_fun: gpio-grp {
> + mux-states = <&can_mux 1>;
> + };
> + };
> +
> chosen {
> stdout-path = &lpuart1;
> };
> @@ -274,7 +293,7 @@ &asrc2 {
>
> &flexcan2 {
> pinctrl-names = "default";
> - pinctrl-0 = <&pinctrl_flexcan2>;
> + pinctrl-0 = <&pinctrl_flexcan2>, <&can2_fun>;
> phys = <&flexcan2_phy>;
> status = "okay";
> };
> @@ -304,13 +323,6 @@ pcal6416: gpio@20 {
> pinctrl-0 = <&pinctrl_pcal6416>;
> pinctrl-names = "default";
> vcc-supply = <&reg_3p3v>;
> -
> - /* When low, select CAN; When high, select gpio. */
> - can-gpio-sel-hog {
> - gpios = <4 GPIO_ACTIVE_HIGH>;
> - gpio-hog;
> - output-low;
> - };
> };
> };
>
>
> --
> 2.34.1
>