* [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver
@ 2025-05-20 3:46 Haibo Chen
2025-05-20 3:46 ` [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges Haibo Chen
` (4 more replies)
0 siblings, 5 replies; 15+ messages in thread
From: Haibo Chen @ 2025-05-20 3:46 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-gpio,
Haibo Chen, peng.fan, wahrenst, conor, Frank Li
Not all GPIO ports have 32 pads, so add 'ngpios' property to specify
the number. This can save some memory when alloc bitmap for GPIO,
besides GPIO tools like gpioinfo will show the correct information.
Some GPIO ports even more special, e.g. GPIO7 on imx94, it only support
IO0~IO9 and IO16~IO27, so add 'gpio-reserved-ranges' property.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
Changes in v3:
- switch PATCH1 and PATCH2, move the binding changes before the DTS changes, to avoid temporary DT build warnings.
- put arm64 and arm dts changes in separated patches.
- add default value for ngpios in binding doc.
- add Frank Li's reviewed by tag
- Link to v2: https://lore.kernel.org/r/20250519-gpio-dts-v2-0-b9e77173e9c5@nxp.com
Changes in v2:
- No changes for PATCH1.
- Add PATCH2 in this verson to avoid dt-binding check.
- Link to v1: https://lore.kernel.org/r/20250516-gpio-dts-v1-1-a9c3505f54c5@nxp.com
---
Haibo Chen (3):
dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges
ARM: dts: add ngpios for vf610 compatible gpio controllers
ARM64: dts: add ngpios for vf610 compatible gpio controllers
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 7 +++++++
arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi | 4 ++++
arch/arm/boot/dts/nxp/vf/vfxxx.dtsi | 5 +++++
arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 3 +++
arch/arm64/boot/dts/freescale/imx93.dtsi | 4 ++++
arch/arm64/boot/dts/freescale/imx94.dtsi | 7 +++++++
arch/arm64/boot/dts/freescale/imx95.dtsi | 5 +++++
7 files changed, 35 insertions(+)
---
base-commit: 484803582c77061b470ac64a634f25f89715be3f
change-id: 20250516-gpio-dts-408311b633c4
Best regards,
--
Haibo Chen <haibo.chen@nxp.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges
2025-05-20 3:46 [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Haibo Chen
@ 2025-05-20 3:46 ` Haibo Chen
2025-05-21 15:18 ` Conor Dooley
2025-05-20 3:46 ` [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers Haibo Chen
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Haibo Chen @ 2025-05-20 3:46 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-gpio,
Haibo Chen, peng.fan, wahrenst, conor, Frank Li
Add optional ngpios and gpio-reserved-ranges property.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
index 4fb32e9aec0a341a50088f3e4352ed4d36f649d3..a31f64b6d40b4bca79672d4eb54a405aa546e243 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
@@ -70,6 +70,13 @@ properties:
minItems: 1
maxItems: 4
+ gpio-reserved-ranges: true
+
+ ngpios:
+ minimum: 1
+ maximum: 32
+ default: 32
+
patternProperties:
"^.+-hog(-[0-9]+)?$":
type: object
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Haibo Chen
2025-05-20 3:46 ` [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges Haibo Chen
@ 2025-05-20 3:46 ` Haibo Chen
2025-05-20 10:54 ` Stefan Wahren
` (2 more replies)
2025-05-20 3:46 ` [PATCH v3 3/3] ARM64: " Haibo Chen
` (2 subsequent siblings)
4 siblings, 3 replies; 15+ messages in thread
From: Haibo Chen @ 2025-05-20 3:46 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-gpio,
Haibo Chen, peng.fan, wahrenst, conor, Frank Li
After commit da5dd31efd24 ("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.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi | 4 ++++
arch/arm/boot/dts/nxp/vf/vfxxx.dtsi | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
index 3c6ef7bfba60986b797bb01b843830d364c96d45..880b9a4f32b0846a773dbf9ad30715c84ac2fda6 100644
--- a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
@@ -399,6 +399,7 @@ gpio_ptc: gpio@40ae0000 {
<&pcc3 IMX7ULP_CLK_PCTLC>;
clock-names = "gpio", "port";
gpio-ranges = <&iomuxc1 0 0 20>;
+ ngpios = <20>;
};
gpio_ptd: gpio@40af0000 {
@@ -413,6 +414,7 @@ gpio_ptd: gpio@40af0000 {
<&pcc3 IMX7ULP_CLK_PCTLD>;
clock-names = "gpio", "port";
gpio-ranges = <&iomuxc1 0 32 12>;
+ ngpios = <12>;
};
gpio_pte: gpio@40b00000 {
@@ -427,6 +429,7 @@ gpio_pte: gpio@40b00000 {
<&pcc3 IMX7ULP_CLK_PCTLE>;
clock-names = "gpio", "port";
gpio-ranges = <&iomuxc1 0 64 16>;
+ ngpios = <16>;
};
gpio_ptf: gpio@40b10000 {
@@ -441,6 +444,7 @@ gpio_ptf: gpio@40b10000 {
<&pcc3 IMX7ULP_CLK_PCTLF>;
clock-names = "gpio", "port";
gpio-ranges = <&iomuxc1 0 96 20>;
+ ngpios = <20>;
};
};
diff --git a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
index 597f20be82f1ee044e14bfaf3bd05cff37a8ad39..a275821c35d41e97eb2139a081ef5765d07672aa 100644
--- a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
+++ b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
@@ -318,6 +318,7 @@ gpio0: gpio@40049000 {
interrupt-controller;
#interrupt-cells = <2>;
gpio-ranges = <&iomuxc 0 0 32>;
+ ngpios = <32>;
};
gpio1: gpio@4004a000 {
@@ -329,6 +330,7 @@ gpio1: gpio@4004a000 {
interrupt-controller;
#interrupt-cells = <2>;
gpio-ranges = <&iomuxc 0 32 32>;
+ ngpios = <32>;
};
gpio2: gpio@4004b000 {
@@ -340,6 +342,7 @@ gpio2: gpio@4004b000 {
interrupt-controller;
#interrupt-cells = <2>;
gpio-ranges = <&iomuxc 0 64 32>;
+ ngpios = <32>;
};
gpio3: gpio@4004c000 {
@@ -351,6 +354,7 @@ gpio3: gpio@4004c000 {
interrupt-controller;
#interrupt-cells = <2>;
gpio-ranges = <&iomuxc 0 96 32>;
+ ngpios = <32>;
};
gpio4: gpio@4004d000 {
@@ -362,6 +366,7 @@ gpio4: gpio@4004d000 {
interrupt-controller;
#interrupt-cells = <2>;
gpio-ranges = <&iomuxc 0 128 7>;
+ ngpios = <7>;
};
anatop: anatop@40050000 {
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 3/3] ARM64: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Haibo Chen
2025-05-20 3:46 ` [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges Haibo Chen
2025-05-20 3:46 ` [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers Haibo Chen
@ 2025-05-20 3:46 ` Haibo Chen
2025-05-21 8:44 ` Stefan Wahren
` (2 more replies)
2025-05-20 22:09 ` [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Linus Walleij
2025-05-21 15:51 ` (subset) " Bartosz Golaszewski
4 siblings, 3 replies; 15+ messages in thread
From: Haibo Chen @ 2025-05-20 3:46 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-gpio,
Haibo Chen, peng.fan, wahrenst, conor, Frank Li
After commit da5dd31efd24 ("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: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 3 +++
arch/arm64/boot/dts/freescale/imx93.dtsi | 4 ++++
arch/arm64/boot/dts/freescale/imx94.dtsi | 7 +++++++
arch/arm64/boot/dts/freescale/imx95.dtsi | 5 +++++
4 files changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
index 2562a35286c208869d11d7fb970ac84638f45088..13b01f3aa2a4950c37e72e04f6bfb5995dc19178 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
@@ -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>;
};
};
};
diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi
index 64cd0776b43d38219fee312baadd4665674a141e..52be83a168d9ee6452a63039c89169d49b63eb60 100644
--- a/arch/arm64/boot/dts/freescale/imx93.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx93.dtsi
@@ -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 {
diff --git a/arch/arm64/boot/dts/freescale/imx94.dtsi b/arch/arm64/boot/dts/freescale/imx94.dtsi
index 3661ea48d7d2994df7b02084e9681beb303aa133..b8ffc428e95be1938bf5e73316b4163acaa04701 100644
--- a/arch/arm64/boot/dts/freescale/imx94.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx94.dtsi
@@ -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 {
diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi
index 632631a2911224cadc16a943cdb467e091e43384..a2f4fcffcde59849bafcedced3ff317ca6c7cf78 100644
--- a/arch/arm64/boot/dts/freescale/imx95.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx95.dtsi
@@ -1152,6 +1152,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 {
@@ -1168,6 +1169,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 {
@@ -1183,6 +1185,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 {
@@ -1198,6 +1201,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 {
@@ -1508,6 +1512,7 @@ gpio1: gpio@47400000 {
<&scmi_clk IMX95_CLK_M33>;
clock-names = "gpio", "port";
gpio-ranges = <&scmi_iomuxc 0 112 16>;
+ ngpios = <16>;
status = "disabled";
};
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 ` [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers Haibo Chen
@ 2025-05-20 10:54 ` Stefan Wahren
2025-05-20 22:14 ` Linus Walleij
2025-06-17 3:02 ` Bough Chen
2025-06-19 3:51 ` Shawn Guo
2 siblings, 1 reply; 15+ messages in thread
From: Stefan Wahren @ 2025-05-20 10:54 UTC (permalink / raw)
To: Haibo Chen, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-gpio,
peng.fan, conor, Frank Li
Hi,
Am 20.05.25 um 05:46 schrieb Haibo Chen:
> After commit da5dd31efd24 ("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.
sorry for asking this dumb question: why do we need the redundant ngpio
property in case there is already gpio-ranges defined? AFAIU the last
cell already contains the necessary information. Or do I missed something?
Best regards
>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> ---
> arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi | 4 ++++
> arch/arm/boot/dts/nxp/vf/vfxxx.dtsi | 5 +++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> index 3c6ef7bfba60986b797bb01b843830d364c96d45..880b9a4f32b0846a773dbf9ad30715c84ac2fda6 100644
> --- a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> +++ b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> @@ -399,6 +399,7 @@ gpio_ptc: gpio@40ae0000 {
> <&pcc3 IMX7ULP_CLK_PCTLC>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 0 20>;
> + ngpios = <20>;
> };
>
> gpio_ptd: gpio@40af0000 {
> @@ -413,6 +414,7 @@ gpio_ptd: gpio@40af0000 {
> <&pcc3 IMX7ULP_CLK_PCTLD>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 32 12>;
> + ngpios = <12>;
> };
>
> gpio_pte: gpio@40b00000 {
> @@ -427,6 +429,7 @@ gpio_pte: gpio@40b00000 {
> <&pcc3 IMX7ULP_CLK_PCTLE>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 64 16>;
> + ngpios = <16>;
> };
>
> gpio_ptf: gpio@40b10000 {
> @@ -441,6 +444,7 @@ gpio_ptf: gpio@40b10000 {
> <&pcc3 IMX7ULP_CLK_PCTLF>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 96 20>;
> + ngpios = <20>;
> };
> };
>
> diff --git a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> index 597f20be82f1ee044e14bfaf3bd05cff37a8ad39..a275821c35d41e97eb2139a081ef5765d07672aa 100644
> --- a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> @@ -318,6 +318,7 @@ gpio0: gpio@40049000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 0 32>;
> + ngpios = <32>;
> };
>
> gpio1: gpio@4004a000 {
> @@ -329,6 +330,7 @@ gpio1: gpio@4004a000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 32 32>;
> + ngpios = <32>;
> };
>
> gpio2: gpio@4004b000 {
> @@ -340,6 +342,7 @@ gpio2: gpio@4004b000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 64 32>;
> + ngpios = <32>;
> };
>
> gpio3: gpio@4004c000 {
> @@ -351,6 +354,7 @@ gpio3: gpio@4004c000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 96 32>;
> + ngpios = <32>;
> };
>
> gpio4: gpio@4004d000 {
> @@ -362,6 +366,7 @@ gpio4: gpio@4004d000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 128 7>;
> + ngpios = <7>;
> };
>
> anatop: anatop@40050000 {
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver
2025-05-20 3:46 [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Haibo Chen
` (2 preceding siblings ...)
2025-05-20 3:46 ` [PATCH v3 3/3] ARM64: " Haibo Chen
@ 2025-05-20 22:09 ` Linus Walleij
2025-05-21 15:51 ` (subset) " Bartosz Golaszewski
4 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2025-05-20 22:09 UTC (permalink / raw)
To: Haibo Chen
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Bartosz Golaszewski, devicetree, imx,
linux-arm-kernel, linux-kernel, linux-gpio, peng.fan, wahrenst,
conor, Frank Li
On Tue, May 20, 2025 at 5:44 AM Haibo Chen <haibo.chen@nxp.com> wrote:
> Not all GPIO ports have 32 pads, so add 'ngpios' property to specify
> the number. This can save some memory when alloc bitmap for GPIO,
> besides GPIO tools like gpioinfo will show the correct information.
>
> Some GPIO ports even more special, e.g. GPIO7 on imx94, it only support
> IO0~IO9 and IO16~IO27, so add 'gpio-reserved-ranges' property.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 10:54 ` Stefan Wahren
@ 2025-05-20 22:14 ` Linus Walleij
2025-05-21 8:40 ` Stefan Wahren
0 siblings, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2025-05-20 22:14 UTC (permalink / raw)
To: Stefan Wahren
Cc: Haibo Chen, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Bartosz Golaszewski, devicetree, imx,
linux-arm-kernel, linux-kernel, linux-gpio, peng.fan, conor,
Frank Li
On Tue, May 20, 2025 at 12:54 PM Stefan Wahren <wahrenst@gmx.net> wrote:
> sorry for asking this dumb question: why do we need the redundant ngpio
> property in case there is already gpio-ranges defined? AFAIU the last
> cell already contains the necessary information. Or do I missed something?
Not all GPIOs on a gpio controller have to be present in
a range.
The ranges can be multiple and have holes in them.
The ranges are also optional.
The fact that this DTS file, for this SoC and on this controller
happens to have a range mapped right over all of the pins
is merely a coinicidence and not a general rule of any kind,
it just apophenia playing games on us.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 22:14 ` Linus Walleij
@ 2025-05-21 8:40 ` Stefan Wahren
0 siblings, 0 replies; 15+ messages in thread
From: Stefan Wahren @ 2025-05-21 8:40 UTC (permalink / raw)
To: Linus Walleij
Cc: Haibo Chen, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Bartosz Golaszewski, devicetree, imx,
linux-arm-kernel, linux-kernel, linux-gpio, peng.fan, conor,
Frank Li
Am 21.05.25 um 00:14 schrieb Linus Walleij:
> On Tue, May 20, 2025 at 12:54 PM Stefan Wahren <wahrenst@gmx.net> wrote:
>
>> sorry for asking this dumb question: why do we need the redundant ngpio
>> property in case there is already gpio-ranges defined? AFAIU the last
>> cell already contains the necessary information. Or do I missed something?
> Not all GPIOs on a gpio controller have to be present in
> a range.
>
> The ranges can be multiple and have holes in them.
>
> The ranges are also optional.
>
> The fact that this DTS file, for this SoC and on this controller
> happens to have a range mapped right over all of the pins
> is merely a coinicidence and not a general rule of any kind,
> it just apophenia playing games on us.
Thanks for clarification
>
> Yours,
> Linus Walleij
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 3/3] ARM64: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 ` [PATCH v3 3/3] ARM64: " Haibo Chen
@ 2025-05-21 8:44 ` Stefan Wahren
2025-06-17 3:02 ` Bough Chen
2025-06-19 3:53 ` Shawn Guo
2 siblings, 0 replies; 15+ messages in thread
From: Stefan Wahren @ 2025-05-21 8:44 UTC (permalink / raw)
To: Haibo Chen, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree, imx, linux-arm-kernel, linux-kernel, linux-gpio,
peng.fan, conor, Frank Li
Am 20.05.25 um 05:46 schrieb Haibo Chen:
> After commit da5dd31efd24 ("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: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Thanks
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges
2025-05-20 3:46 ` [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges Haibo Chen
@ 2025-05-21 15:18 ` Conor Dooley
0 siblings, 0 replies; 15+ messages in thread
From: Conor Dooley @ 2025-05-21 15:18 UTC (permalink / raw)
To: Haibo Chen
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski, devicetree, imx,
linux-arm-kernel, linux-kernel, linux-gpio, peng.fan, wahrenst,
Frank Li
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
On Tue, May 20, 2025 at 11:46:12AM +0800, Haibo Chen wrote:
> Add optional ngpios and gpio-reserved-ranges property.
>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: (subset) [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver
2025-05-20 3:46 [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Haibo Chen
` (3 preceding siblings ...)
2025-05-20 22:09 ` [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Linus Walleij
@ 2025-05-21 15:51 ` Bartosz Golaszewski
4 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2025-05-21 15:51 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski, Haibo Chen
Cc: Bartosz Golaszewski, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-gpio, peng.fan, wahrenst, conor, Frank Li
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Tue, 20 May 2025 11:46:11 +0800, Haibo Chen wrote:
> Not all GPIO ports have 32 pads, so add 'ngpios' property to specify
> the number. This can save some memory when alloc bitmap for GPIO,
> besides GPIO tools like gpioinfo will show the correct information.
>
> Some GPIO ports even more special, e.g. GPIO7 on imx94, it only support
> IO0~IO9 and IO16~IO27, so add 'gpio-reserved-ranges' property.
>
> [...]
Applied, thanks!
[1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges
https://git.kernel.org/brgl/linux/c/4e9d73034196ac8ab496bb47583197b36ba13327
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 ` [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers Haibo Chen
2025-05-20 10:54 ` Stefan Wahren
@ 2025-06-17 3:02 ` Bough Chen
2025-06-19 3:51 ` Shawn Guo
2 siblings, 0 replies; 15+ messages in thread
From: Bough Chen @ 2025-06-17 3:02 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Peng Fan, wahrenst@gmx.net, conor@kernel.org, Frank Li
Gentle ping...
> -----Original Message-----
> From: Bough Chen <haibo.chen@nxp.com>
> Sent: 2025年5月20日 11:46
> To: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>;
> Conor Dooley <conor+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>;
> Sascha Hauer <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>; Stefan
> Agner <stefan@agner.ch>; Linus Walleij <linus.walleij@linaro.org>; Bartosz
> Golaszewski <brgl@bgdev.pl>
> Cc: devicetree@vger.kernel.org; imx@lists.linux.dev;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> linux-gpio@vger.kernel.org; Bough Chen <haibo.chen@nxp.com>; Peng Fan
> <peng.fan@nxp.com>; wahrenst@gmx.net; conor@kernel.org; Frank Li
> <frank.li@nxp.com>
> Subject: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio
> controllers
>
> After commit da5dd31efd24 ("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.
>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> ---
> arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi | 4 ++++
> arch/arm/boot/dts/nxp/vf/vfxxx.dtsi | 5 +++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> index
> 3c6ef7bfba60986b797bb01b843830d364c96d45..880b9a4f32b0846a773dbf9a
> d30715c84ac2fda6 100644
> --- a/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> +++ b/arch/arm/boot/dts/nxp/imx/imx7ulp.dtsi
> @@ -399,6 +399,7 @@ gpio_ptc: gpio@40ae0000 {
> <&pcc3 IMX7ULP_CLK_PCTLC>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 0 20>;
> + ngpios = <20>;
> };
>
> gpio_ptd: gpio@40af0000 {
> @@ -413,6 +414,7 @@ gpio_ptd: gpio@40af0000 {
> <&pcc3 IMX7ULP_CLK_PCTLD>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 32 12>;
> + ngpios = <12>;
> };
>
> gpio_pte: gpio@40b00000 {
> @@ -427,6 +429,7 @@ gpio_pte: gpio@40b00000 {
> <&pcc3 IMX7ULP_CLK_PCTLE>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 64 16>;
> + ngpios = <16>;
> };
>
> gpio_ptf: gpio@40b10000 {
> @@ -441,6 +444,7 @@ gpio_ptf: gpio@40b10000 {
> <&pcc3 IMX7ULP_CLK_PCTLF>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 96 20>;
> + ngpios = <20>;
> };
> };
>
> diff --git a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> index
> 597f20be82f1ee044e14bfaf3bd05cff37a8ad39..a275821c35d41e97eb2139a08
> 1ef5765d07672aa 100644
> --- a/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/nxp/vf/vfxxx.dtsi
> @@ -318,6 +318,7 @@ gpio0: gpio@40049000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 0 32>;
> + ngpios = <32>;
> };
>
> gpio1: gpio@4004a000 {
> @@ -329,6 +330,7 @@ gpio1: gpio@4004a000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 32 32>;
> + ngpios = <32>;
> };
>
> gpio2: gpio@4004b000 {
> @@ -340,6 +342,7 @@ gpio2: gpio@4004b000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 64 32>;
> + ngpios = <32>;
> };
>
> gpio3: gpio@4004c000 {
> @@ -351,6 +354,7 @@ gpio3: gpio@4004c000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 96 32>;
> + ngpios = <32>;
> };
>
> gpio4: gpio@4004d000 {
> @@ -362,6 +366,7 @@ gpio4: gpio@4004d000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 128 7>;
> + ngpios = <7>;
> };
>
> anatop: anatop@40050000 {
>
> --
> 2.34.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v3 3/3] ARM64: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 ` [PATCH v3 3/3] ARM64: " Haibo Chen
2025-05-21 8:44 ` Stefan Wahren
@ 2025-06-17 3:02 ` Bough Chen
2025-06-19 3:53 ` Shawn Guo
2 siblings, 0 replies; 15+ messages in thread
From: Bough Chen @ 2025-06-17 3:02 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Peng Fan, wahrenst@gmx.net, conor@kernel.org, Frank Li
Gentle ping...
> -----Original Message-----
> From: Bough Chen <haibo.chen@nxp.com>
> Sent: 2025年5月20日 11:46
> To: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>;
> Conor Dooley <conor+dt@kernel.org>; Shawn Guo <shawnguo@kernel.org>;
> Sascha Hauer <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>; Stefan
> Agner <stefan@agner.ch>; Linus Walleij <linus.walleij@linaro.org>; Bartosz
> Golaszewski <brgl@bgdev.pl>
> Cc: devicetree@vger.kernel.org; imx@lists.linux.dev;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> linux-gpio@vger.kernel.org; Bough Chen <haibo.chen@nxp.com>; Peng Fan
> <peng.fan@nxp.com>; wahrenst@gmx.net; conor@kernel.org; Frank Li
> <frank.li@nxp.com>
> Subject: [PATCH v3 3/3] ARM64: dts: add ngpios for vf610 compatible gpio
> controllers
>
> After commit da5dd31efd24 ("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: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> ---
> arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 3 +++
> arch/arm64/boot/dts/freescale/imx93.dtsi | 4 ++++
> arch/arm64/boot/dts/freescale/imx94.dtsi | 7 +++++++
> arch/arm64/boot/dts/freescale/imx95.dtsi | 5 +++++
> 4 files changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
> b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
> index
> 2562a35286c208869d11d7fb970ac84638f45088..13b01f3aa2a4950c37e72e04f
> 6bfb5995dc19178 100644
> --- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
> @@ -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>;
> };
> };
> };
> diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi
> b/arch/arm64/boot/dts/freescale/imx93.dtsi
> index
> 64cd0776b43d38219fee312baadd4665674a141e..52be83a168d9ee6452a6303
> 9c89169d49b63eb60 100644
> --- a/arch/arm64/boot/dts/freescale/imx93.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx93.dtsi
> @@ -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 {
> diff --git a/arch/arm64/boot/dts/freescale/imx94.dtsi
> b/arch/arm64/boot/dts/freescale/imx94.dtsi
> index
> 3661ea48d7d2994df7b02084e9681beb303aa133..b8ffc428e95be1938bf5e733
> 16b4163acaa04701 100644
> --- a/arch/arm64/boot/dts/freescale/imx94.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx94.dtsi
> @@ -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 {
> diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi
> b/arch/arm64/boot/dts/freescale/imx95.dtsi
> index
> 632631a2911224cadc16a943cdb467e091e43384..a2f4fcffcde59849bafcedced3
> ff317ca6c7cf78 100644
> --- a/arch/arm64/boot/dts/freescale/imx95.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx95.dtsi
> @@ -1152,6 +1152,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 {
> @@ -1168,6 +1169,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 {
> @@ -1183,6 +1185,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 {
> @@ -1198,6 +1201,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 {
> @@ -1508,6 +1512,7 @@ gpio1: gpio@47400000 {
> <&scmi_clk IMX95_CLK_M33>;
> clock-names = "gpio", "port";
> gpio-ranges = <&scmi_iomuxc 0 112 16>;
> + ngpios = <16>;
> status = "disabled";
> };
>
>
> --
> 2.34.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 ` [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers Haibo Chen
2025-05-20 10:54 ` Stefan Wahren
2025-06-17 3:02 ` Bough Chen
@ 2025-06-19 3:51 ` Shawn Guo
2 siblings, 0 replies; 15+ messages in thread
From: Shawn Guo @ 2025-06-19 3:51 UTC (permalink / raw)
To: Haibo Chen
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski, devicetree, imx,
linux-arm-kernel, linux-kernel, linux-gpio, peng.fan, wahrenst,
conor, Frank Li
On Tue, May 20, 2025 at 11:46:13AM +0800, Haibo Chen wrote:
> After commit da5dd31efd24 ("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.
>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 3/3] ARM64: dts: add ngpios for vf610 compatible gpio controllers
2025-05-20 3:46 ` [PATCH v3 3/3] ARM64: " Haibo Chen
2025-05-21 8:44 ` Stefan Wahren
2025-06-17 3:02 ` Bough Chen
@ 2025-06-19 3:53 ` Shawn Guo
2 siblings, 0 replies; 15+ messages in thread
From: Shawn Guo @ 2025-06-19 3:53 UTC (permalink / raw)
To: Haibo Chen
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Stefan Agner, Linus Walleij, Bartosz Golaszewski, devicetree, imx,
linux-arm-kernel, linux-kernel, linux-gpio, peng.fan, wahrenst,
conor, Frank Li
On Tue, May 20, 2025 at 11:46:14AM +0800, Haibo Chen wrote:
> After commit da5dd31efd24 ("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: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Historically we use "ARM: dts: ..." prefix for arch/arm/boot/dts changes,
but use "arm64: dts: ..." for arch/arm64/boot/dts ones.
Fixed the prefix up and applied, thanks!
Shawn
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-06-19 4:05 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 3:46 [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Haibo Chen
2025-05-20 3:46 ` [PATCH v3 1/3] dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges Haibo Chen
2025-05-21 15:18 ` Conor Dooley
2025-05-20 3:46 ` [PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers Haibo Chen
2025-05-20 10:54 ` Stefan Wahren
2025-05-20 22:14 ` Linus Walleij
2025-05-21 8:40 ` Stefan Wahren
2025-06-17 3:02 ` Bough Chen
2025-06-19 3:51 ` Shawn Guo
2025-05-20 3:46 ` [PATCH v3 3/3] ARM64: " Haibo Chen
2025-05-21 8:44 ` Stefan Wahren
2025-06-17 3:02 ` Bough Chen
2025-06-19 3:53 ` Shawn Guo
2025-05-20 22:09 ` [PATCH v3 0/3] Add 'ngpios' and 'gpio-reserved-ranges' for vf610-gpio driver Linus Walleij
2025-05-21 15:51 ` (subset) " Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).