Commit 40567fa4 authored by Haibo Chen's avatar Haibo Chen Committed by Shawn Guo
Browse files

arm64: dts: add ngpios for vf610 compatible gpio controllers



After commit da5dd31e ("gpio: vf610: Switch to gpio-mmio"),
the vf610 GPIO driver no longer uses the static number 32 for
gc->ngpio. This allows users to configure the number of GPIOs
per port.

And some gpio controllers did have less pads. So add 'ngpios' here,
this can save some memory when request bitmap, and also show user
more accurate information when use gpio tools.

Besides, some gpio controllers have hole in the gpio ranges, so use
'gpio-reserved-ranges' to cover that, then the gpioinfo tool show the
correct result.

Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
Reviewed-by: default avatarStefan Wahren <wahrenst@gmx.net>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent dea4914e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -686,6 +686,7 @@ gpioe: gpio@2d000000 {
					 <&pcc4 IMX8ULP_CLK_PCTLE>;
				clock-names = "gpio", "port";
				gpio-ranges = <&iomuxc1 0 32 24>;
				ngpios = <24>;
		};

		gpiof: gpio@2d010000 {
@@ -701,6 +702,7 @@ gpiof: gpio@2d010000 {
					 <&pcc4 IMX8ULP_CLK_PCTLF>;
				clock-names = "gpio", "port";
				gpio-ranges = <&iomuxc1 0 64 32>;
				ngpios = <32>;
		};

		per_bridge5: bus@2d800000 {
@@ -855,6 +857,7 @@ gpiod: gpio@2e200000 {
				 <&pcc5 IMX8ULP_CLK_RGPIOD>;
			clock-names = "gpio", "port";
			gpio-ranges = <&iomuxc1 0 0 24>;
			ngpios = <24>;
		};
	};
};
+4 −0
Original line number Diff line number Diff line
@@ -1197,6 +1197,7 @@ gpio2: gpio@43810000 {
				 <&clk IMX93_CLK_GPIO2_GATE>;
			clock-names = "gpio", "port";
			gpio-ranges = <&iomuxc 0 4 30>;
			ngpios = <30>;
		};

		gpio3: gpio@43820000 {
@@ -1213,6 +1214,7 @@ gpio3: gpio@43820000 {
			clock-names = "gpio", "port";
			gpio-ranges = <&iomuxc 0 84 8>, <&iomuxc 8 66 18>,
				      <&iomuxc 26 34 2>, <&iomuxc 28 0 4>;
			ngpios = <32>;
		};

		gpio4: gpio@43830000 {
@@ -1228,6 +1230,7 @@ gpio4: gpio@43830000 {
				 <&clk IMX93_CLK_GPIO4_GATE>;
			clock-names = "gpio", "port";
			gpio-ranges = <&iomuxc 0 38 28>, <&iomuxc 28 36 2>;
			ngpios = <30>;
		};

		gpio1: gpio@47400000 {
@@ -1243,6 +1246,7 @@ gpio1: gpio@47400000 {
				 <&clk IMX93_CLK_GPIO1_GATE>;
			clock-names = "gpio", "port";
			gpio-ranges = <&iomuxc 0 92 16>;
			ngpios = <16>;
		};

		ocotp: efuse@47510000 {
+7 −0
Original line number Diff line number Diff line
@@ -785,6 +785,7 @@ gpio2: gpio@43810000 {
			#gpio-cells = <2>;
			gpio-controller;
			gpio-ranges = <&scmi_iomuxc 0 4 32>;
			ngpios = <32>;
		};

		gpio3: gpio@43820000 {
@@ -797,6 +798,7 @@ gpio3: gpio@43820000 {
			#gpio-cells = <2>;
			gpio-controller;
			gpio-ranges = <&scmi_iomuxc 0 36 26>;
			ngpios = <26>;
		};

		gpio4: gpio@43840000 {
@@ -810,6 +812,7 @@ gpio4: gpio@43840000 {
			gpio-controller;
			gpio-ranges = <&scmi_iomuxc 0 62 4>, <&scmi_iomuxc 4 0 4>,
				      <&scmi_iomuxc 8 140 12>, <&scmi_iomuxc 20 164 12>;
			ngpios = <32>;
		};

		gpio5: gpio@43850000 {
@@ -822,6 +825,7 @@ gpio5: gpio@43850000 {
			#gpio-cells = <2>;
			gpio-controller;
			gpio-ranges = <&scmi_iomuxc 0 108 32>;
			ngpios = <32>;
		};

		gpio6: gpio@43860000 {
@@ -834,6 +838,7 @@ gpio6: gpio@43860000 {
			#gpio-cells = <2>;
			gpio-controller;
			gpio-ranges = <&scmi_iomuxc 0 66 32>;
			ngpios = <32>;
		};

		gpio7: gpio@43870000 {
@@ -846,6 +851,8 @@ gpio7: gpio@43870000 {
			#gpio-cells = <2>;
			gpio-controller;
			gpio-ranges = <&scmi_iomuxc 0 98 10>, <&scmi_iomuxc 16 152 12>;
			gpio-reserved-ranges = <10 6>;
			ngpios = <28>;
		};

		aips1: bus@44000000 {
+5 −0
Original line number Diff line number Diff line
@@ -1151,6 +1151,7 @@ gpio2: gpio@43810000 {
				 <&scmi_clk IMX95_CLK_BUSWAKEUP>;
			clock-names = "gpio", "port";
			gpio-ranges = <&scmi_iomuxc 0 4 32>;
			ngpios = <32>;
		};

		gpio3: gpio@43820000 {
@@ -1167,6 +1168,7 @@ gpio3: gpio@43820000 {
			clock-names = "gpio", "port";
			gpio-ranges = <&scmi_iomuxc 0 104 8>, <&scmi_iomuxc 8 74 18>,
				      <&scmi_iomuxc 26 42 2>, <&scmi_iomuxc 28 0 4>;
			ngpios = <32>;
		};

		gpio4: gpio@43840000 {
@@ -1182,6 +1184,7 @@ gpio4: gpio@43840000 {
				 <&scmi_clk IMX95_CLK_BUSWAKEUP>;
			clock-names = "gpio", "port";
			gpio-ranges = <&scmi_iomuxc 0 46 28>, <&scmi_iomuxc 28 44 2>;
			ngpios = <30>;
		};

		gpio5: gpio@43850000 {
@@ -1197,6 +1200,7 @@ gpio5: gpio@43850000 {
				 <&scmi_clk IMX95_CLK_BUSWAKEUP>;
			clock-names = "gpio", "port";
			gpio-ranges = <&scmi_iomuxc 0 92 12>, <&scmi_iomuxc 12 36 6>;
			ngpios = <18>;
		};

		aips1: bus@44000000 {
@@ -1506,6 +1510,7 @@ gpio1: gpio@47400000 {
				 <&scmi_clk IMX95_CLK_M33>;
			clock-names = "gpio", "port";
			gpio-ranges = <&scmi_iomuxc 0 112 16>;
			ngpios = <16>;
			status = "disabled";
		};