[PATCH v3 2/3] ARM: dts: add ngpios for vf610 compatible gpio controllers
Stefan Wahren
wahrenst at gmx.net
Tue May 20 03:54:49 PDT 2025
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 at nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen at 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 at 40ae0000 {
> <&pcc3 IMX7ULP_CLK_PCTLC>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 0 20>;
> + ngpios = <20>;
> };
>
> gpio_ptd: gpio at 40af0000 {
> @@ -413,6 +414,7 @@ gpio_ptd: gpio at 40af0000 {
> <&pcc3 IMX7ULP_CLK_PCTLD>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 32 12>;
> + ngpios = <12>;
> };
>
> gpio_pte: gpio at 40b00000 {
> @@ -427,6 +429,7 @@ gpio_pte: gpio at 40b00000 {
> <&pcc3 IMX7ULP_CLK_PCTLE>;
> clock-names = "gpio", "port";
> gpio-ranges = <&iomuxc1 0 64 16>;
> + ngpios = <16>;
> };
>
> gpio_ptf: gpio at 40b10000 {
> @@ -441,6 +444,7 @@ gpio_ptf: gpio at 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 at 40049000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 0 32>;
> + ngpios = <32>;
> };
>
> gpio1: gpio at 4004a000 {
> @@ -329,6 +330,7 @@ gpio1: gpio at 4004a000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 32 32>;
> + ngpios = <32>;
> };
>
> gpio2: gpio at 4004b000 {
> @@ -340,6 +342,7 @@ gpio2: gpio at 4004b000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 64 32>;
> + ngpios = <32>;
> };
>
> gpio3: gpio at 4004c000 {
> @@ -351,6 +354,7 @@ gpio3: gpio at 4004c000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 96 32>;
> + ngpios = <32>;
> };
>
> gpio4: gpio at 4004d000 {
> @@ -362,6 +366,7 @@ gpio4: gpio at 4004d000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> gpio-ranges = <&iomuxc 0 128 7>;
> + ngpios = <7>;
> };
>
> anatop: anatop at 40050000 {
>
More information about the linux-arm-kernel
mailing list