Skip to contentSkip to conversation

arm64: dts: ls1046a: add pinctrl node

PATCH In review David Leonard 3 participants 3 messages Aug 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/6 arm64: dts: ls1046a: add pinctrl node

Add a node for the LS1046A's pinmux controller and related pinctrl properties for the nodes using the gpio and i2c functions it controls.

---
 .../arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +36 -0
index 200e52622f99..d2286fd6f972 100644
@@ -350,6 +350,29 @@ extirq: interrupt-controller@1ac {
 			};
 		};
 
+		pinmux: pinmux@157040c {
+			compatible = "fsl,ls1046a-pinctrl";
+			reg = <0 0x157040c 0 4>;
+			big-endian;
+
+			pinctrl_i2c2: pinctrl-i2c2 {
+				groups = "L4", "M4";
+				function = "i2c";
+			};
+			pinctrl_i2c2_gpio: pinctrl-i2c2-gpio {
+				groups = "L4", "M4";
+				function = "gpio";
+			};
+			pinctrl_i2c3: pinctrl-i2c3 {
+				groups = "M3", "N3";
+				function = "i2c";
+			};
+			pinctrl_i2c3_gpio: pinctrl-i2c3-gpio {
+				groups = "M3", "N3";
+				function = "gpio";
+			};
+		};
+
 		crypto: crypto@1700000 {
 			compatible = "fsl,sec-v5.4", "fsl,sec-v5.0",
 				     "fsl,sec-v4.0";
@@ -537,6 +560,10 @@ i2c2: i2c@21a0000 {
 			clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
 					    QORIQ_CLK_PLL_DIV(2)>;
 			scl-gpios = <&gpio3 10 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			sda-gpios = <&gpio3 11 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			pinctrl-names = "default", "gpio";
+			pinctrl-0 = <&pinctrl_i2c2>;
+			pinctrl-1 = <&pinctrl_i2c2_gpio>;
 			status = "disabled";
 		};
 
@@ -549,6 +576,10 @@ i2c3: i2c@21b0000 {
 			clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
 					    QORIQ_CLK_PLL_DIV(2)>;
 			scl-gpios = <&gpio3 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			sda-gpios = <&gpio3 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			pinctrl-names = "default", "gpio";
+			pinctrl-0 = <&pinctrl_i2c3>;
+			pinctrl-1 = <&pinctrl_i2c3_gpio>;
 			status = "disabled";
 		};
 
@@ -626,6 +657,11 @@ gpio3: gpio@2330000 {
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
+			gpio-ranges = <&pinmux 10 0 0>,
+				      <&pinmux 11 0 0>,
+				      <&pinmux 12 0 0>,
+				      <&pinmux 13 0 0>;
+			gpio-ranges-group-names = "L4", "M4", "M3", "N3";
 		};
 
 		lpuart0: serial@2950000 {
Signature · 1 line
2.43.0
#1 lore raw
Quoted 1 line · David Leonard

You messages have weird blank line in front.

Quoted 13 lines

Add a node for the LS1046A's pinmux controller and related pinctrl properties for the nodes using the gpio and i2c functions it controls.

---
  .../arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 36 +++++++++++++++++++
  1 file changed, 36 insertions(+)
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +0 -0
index 200e52622f99..d2286fd6f972 100644

arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi extirq: interrupt-controller@1ac { · line 353

Quoted 4 lines
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +1 -0
@@ -350,6 +350,29 @@ extirq: interrupt-controller@1ac {
  			};
  		};
 
+		pinmux: pinmux@157040c {

pinctrl@

Keep your code consistent.

Best regards,
Krzysztof

maintainer
#2 lore raw
In reply to David Leonard
Quoted 14 lines · David Leonard

Add a node for the LS1046A's pinmux controller and related pinctrl properties for the nodes using the gpio and i2c functions it controls.

---
 .../arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +0 -0
index 200e52622f99..d2286fd6f972 100644

arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi extirq: interrupt-controller@1ac { · line 356

Quoted 7 lines
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +4 -0
@@ -350,6 +350,29 @@ extirq: interrupt-controller@1ac {
 			};
 		};
 
+		pinmux: pinmux@157040c {
+			compatible = "fsl,ls1046a-pinctrl";
+			reg = <0 0x157040c 0 4>;
+			big-endian;

I can't find fsl,ls1046a-pinctrl in binding doc.
git grep -r fsl,ls1046a-pinctrl Documentation/

I suggest you use pinctrl-single.

Frank

Quoted 59 lines
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +32 -1
+
+			pinctrl_i2c2: pinctrl-i2c2 {
+				groups = "L4", "M4";
+				function = "i2c";
+			};
+			pinctrl_i2c2_gpio: pinctrl-i2c2-gpio {
+				groups = "L4", "M4";
+				function = "gpio";
+			};
+			pinctrl_i2c3: pinctrl-i2c3 {
+				groups = "M3", "N3";
+				function = "i2c";
+			};
+			pinctrl_i2c3_gpio: pinctrl-i2c3-gpio {
+				groups = "M3", "N3";
+				function = "gpio";
+			};
+		};
+
 		crypto: crypto@1700000 {
 			compatible = "fsl,sec-v5.4", "fsl,sec-v5.0",
 				     "fsl,sec-v4.0";
@@ -537,6 +560,10 @@ i2c2: i2c@21a0000 {
 			clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
 					    QORIQ_CLK_PLL_DIV(2)>;
 			scl-gpios = <&gpio3 10 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			sda-gpios = <&gpio3 11 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			pinctrl-names = "default", "gpio";
+			pinctrl-0 = <&pinctrl_i2c2>;
+			pinctrl-1 = <&pinctrl_i2c2_gpio>;
 			status = "disabled";
 		};
 
@@ -549,6 +576,10 @@ i2c3: i2c@21b0000 {
 			clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
 					    QORIQ_CLK_PLL_DIV(2)>;
 			scl-gpios = <&gpio3 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			sda-gpios = <&gpio3 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+			pinctrl-names = "default", "gpio";
+			pinctrl-0 = <&pinctrl_i2c3>;
+			pinctrl-1 = <&pinctrl_i2c3_gpio>;
 			status = "disabled";
 		};
 
@@ -626,6 +657,11 @@ gpio3: gpio@2330000 {
 			#gpio-cells = <2>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
+			gpio-ranges = <&pinmux 10 0 0>,
+				      <&pinmux 11 0 0>,
+				      <&pinmux 12 0 0>,
+				      <&pinmux 13 0 0>;
+			gpio-ranges-group-names = "L4", "M4", "M3", "N3";
 		};
 
 		lpuart0: serial@2950000 {
--

2.43.0