* [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins
@ 2024-01-17 9:44 Hector Palacios
2024-01-17 9:44 ` [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property Hector Palacios
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Hector Palacios @ 2024-01-17 9:44 UTC (permalink / raw)
To: linus.walleij, brgl, robh+dt, krzysztof.kozlowski+dt
Cc: andy, conor+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
stefan, linux-gpio, devicetree, linux-kernel, hector.palacios
All four GPIO ports of i.MX93 SoC show 32 pins available, but
not every port has 32 pins.
Add support on the GPIO driver to 'ngpios' property and set
the truly available pins on the SoC device tree.
v4
* Remove 'description' from 'npgio' field in bindings as it
is a generic one.
v3
* Move DT bindings to a patch of its own
* Improve reasoning for adding support in driver
v2
* Add 'ngpios' property to DT binding for proper validation
Hector Palacios (3):
gpio: vf610: add support to DT 'ngpios' property
dt-bindings: gpio: vf610: add optional 'ngpios'
arm64: dts: imx93: specify available 'ngpios' per GPIO port
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 5 +++++
arch/arm64/boot/dts/freescale/imx93.dtsi | 4 ++++
drivers/gpio/gpio-vf610.c | 7 ++++++-
3 files changed, 15 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property
2024-01-17 9:44 [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Hector Palacios
@ 2024-01-17 9:44 ` Hector Palacios
2024-01-17 20:53 ` Andy Shevchenko
2024-01-17 9:44 ` [PATCH v4 2/3] dt-bindings: gpio: vf610: add optional 'ngpios' Hector Palacios
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Hector Palacios @ 2024-01-17 9:44 UTC (permalink / raw)
To: linus.walleij, brgl, robh+dt, krzysztof.kozlowski+dt
Cc: andy, conor+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
stefan, linux-gpio, devicetree, linux-kernel, hector.palacios
Some SoCs, such as i.MX93, don't have all 32 pins available
per port. Allow optional generic 'ngpios' property to be
specified from the device tree and default to
VF610_GPIO_PER_PORT (32) if the property does not exist.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/gpio/gpio-vf610.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 07e5e6323e86..4abdf75e9a0a 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -276,6 +276,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
struct vf610_gpio_port *port;
struct gpio_chip *gc;
struct gpio_irq_chip *girq;
+ u32 ngpios;
int i;
int ret;
bool dual_base;
@@ -353,7 +354,11 @@ static int vf610_gpio_probe(struct platform_device *pdev)
gc = &port->gc;
gc->parent = dev;
gc->label = dev_name(dev);
- gc->ngpio = VF610_GPIO_PER_PORT;
+ ret = device_property_read_u32(dev, "ngpios", &ngpios);
+ if (ret || ngpios > VF610_GPIO_PER_PORT)
+ gc->ngpio = VF610_GPIO_PER_PORT;
+ else
+ gc->ngpio = (u16)ngpios;
gc->base = -1;
gc->request = gpiochip_generic_request;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 2/3] dt-bindings: gpio: vf610: add optional 'ngpios'
2024-01-17 9:44 [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Hector Palacios
2024-01-17 9:44 ` [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property Hector Palacios
@ 2024-01-17 9:44 ` Hector Palacios
2024-01-17 10:09 ` Krzysztof Kozlowski
2024-01-17 9:44 ` [PATCH v4 3/3] arm64: dts: imx93: specify available 'ngpios' per GPIO port Hector Palacios
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Hector Palacios @ 2024-01-17 9:44 UTC (permalink / raw)
To: linus.walleij, brgl, robh+dt, krzysztof.kozlowski+dt
Cc: andy, conor+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
stefan, linux-gpio, devicetree, linux-kernel, hector.palacios
Some SoCs, such as i.MX93, don't have all 32 pins available
per port. Allow optional generic 'ngpios' property to be
specified from the device tree and default to 32 if the
property does not exist.
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
---
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
index a27f92950257..1702aff5e0e9 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
@@ -65,6 +65,11 @@ properties:
minItems: 1
maxItems: 4
+ ngpios:
+ minimum: 1
+ maximum: 32
+ default: 32
+
patternProperties:
"^.+-hog(-[0-9]+)?$":
type: object
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 3/3] arm64: dts: imx93: specify available 'ngpios' per GPIO port
2024-01-17 9:44 [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Hector Palacios
2024-01-17 9:44 ` [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property Hector Palacios
2024-01-17 9:44 ` [PATCH v4 2/3] dt-bindings: gpio: vf610: add optional 'ngpios' Hector Palacios
@ 2024-01-17 9:44 ` Hector Palacios
2024-01-17 10:04 ` [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Bartosz Golaszewski
2024-07-18 17:17 ` Stefan Wahren
4 siblings, 0 replies; 8+ messages in thread
From: Hector Palacios @ 2024-01-17 9:44 UTC (permalink / raw)
To: linus.walleij, brgl, robh+dt, krzysztof.kozlowski+dt
Cc: andy, conor+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
stefan, linux-gpio, devicetree, linux-kernel, hector.palacios
According to NXP HRM for i.MX93, the following GPIO pins are available:
- GPIO1: 16 pins (0..15)
- GPIO2: 30 pins (0..29)
- GPIO3: 32 pins (0..31)
- GPIO4: 30 pins (0..29)
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
---
arch/arm64/boot/dts/freescale/imx93.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi
index 34c0540276d1..7eb2cab7c749 100644
--- a/arch/arm64/boot/dts/freescale/imx93.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx93.dtsi
@@ -970,6 +970,7 @@ gpio2: gpio@43810000 {
<&clk IMX93_CLK_GPIO2_GATE>;
clock-names = "gpio", "port";
gpio-ranges = <&iomuxc 0 4 30>;
+ ngpios = <30>;
};
gpio3: gpio@43820000 {
@@ -986,6 +987,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 {
@@ -1001,6 +1003,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 {
@@ -1016,6 +1019,7 @@ gpio1: gpio@47400000 {
<&clk IMX93_CLK_GPIO1_GATE>;
clock-names = "gpio", "port";
gpio-ranges = <&iomuxc 0 92 16>;
+ ngpios = <16>;
};
ocotp: efuse@47510000 {
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins
2024-01-17 9:44 [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Hector Palacios
` (2 preceding siblings ...)
2024-01-17 9:44 ` [PATCH v4 3/3] arm64: dts: imx93: specify available 'ngpios' per GPIO port Hector Palacios
@ 2024-01-17 10:04 ` Bartosz Golaszewski
2024-07-18 17:17 ` Stefan Wahren
4 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2024-01-17 10:04 UTC (permalink / raw)
To: Hector Palacios
Cc: linus.walleij, robh+dt, krzysztof.kozlowski+dt, andy, conor+dt,
shawnguo, s.hauer, kernel, festevam, linux-imx, stefan,
linux-gpio, devicetree, linux-kernel
On Wed, Jan 17, 2024 at 10:45 AM Hector Palacios
<hector.palacios@digi.com> wrote:
>
> All four GPIO ports of i.MX93 SoC show 32 pins available, but
> not every port has 32 pins.
> Add support on the GPIO driver to 'ngpios' property and set
> the truly available pins on the SoC device tree.
>
> v4
> * Remove 'description' from 'npgio' field in bindings as it
> is a generic one.
>
> v3
> * Move DT bindings to a patch of its own
> * Improve reasoning for adding support in driver
>
> v2
> * Add 'ngpios' property to DT binding for proper validation
>
> Hector Palacios (3):
> gpio: vf610: add support to DT 'ngpios' property
> dt-bindings: gpio: vf610: add optional 'ngpios'
> arm64: dts: imx93: specify available 'ngpios' per GPIO port
>
> Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 5 +++++
> arch/arm64/boot/dts/freescale/imx93.dtsi | 4 ++++
> drivers/gpio/gpio-vf610.c | 7 ++++++-
> 3 files changed, 15 insertions(+), 1 deletion(-)
>
>
Please don't spam the list with new versions less than an hour apart.
Leave the maintainers at least a couple days to respond. Especially
during the merge window.
Bartosz
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 2/3] dt-bindings: gpio: vf610: add optional 'ngpios'
2024-01-17 9:44 ` [PATCH v4 2/3] dt-bindings: gpio: vf610: add optional 'ngpios' Hector Palacios
@ 2024-01-17 10:09 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-17 10:09 UTC (permalink / raw)
To: Hector Palacios, linus.walleij, brgl, robh+dt,
krzysztof.kozlowski+dt
Cc: andy, conor+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
stefan, linux-gpio, devicetree, linux-kernel
On 17/01/2024 10:44, Hector Palacios wrote:
> Some SoCs, such as i.MX93, don't have all 32 pins available
> per port. Allow optional generic 'ngpios' property to be
> specified from the device tree and default to 32 if the
> property does not exist.
>
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Please give maintainers chance to review your patches... one patchset
per day. During merge window maybe rarer.
---
This is an automated instruction, just in case, because many review tags
are being ignored. If you know the process, you can skip it (please do
not feel offended by me posting it here - no bad intentions intended).
If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions, under or above your Signed-off-by tag. Tag is "received", when
provided in a message replied to you on the mailing list. Tools like b4
can help here. However, there's no need to repost patches *only* to add
the tags. The upstream maintainer will do that for tags received on the
version they apply.
https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property
2024-01-17 9:44 ` [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property Hector Palacios
@ 2024-01-17 20:53 ` Andy Shevchenko
0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2024-01-17 20:53 UTC (permalink / raw)
To: Hector Palacios
Cc: linus.walleij, brgl, robh+dt, krzysztof.kozlowski+dt, andy,
conor+dt, shawnguo, s.hauer, kernel, festevam, linux-imx, stefan,
linux-gpio, devicetree, linux-kernel
On Wed, Jan 17, 2024 at 11:46 AM Hector Palacios
<hector.palacios@digi.com> wrote:
>
> Some SoCs, such as i.MX93, don't have all 32 pins available
> per port. Allow optional generic 'ngpios' property to be
> specified from the device tree and default to
> VF610_GPIO_PER_PORT (32) if the property does not exist.
Same comment/Q as per v3.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins
2024-01-17 9:44 [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Hector Palacios
` (3 preceding siblings ...)
2024-01-17 10:04 ` [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Bartosz Golaszewski
@ 2024-07-18 17:17 ` Stefan Wahren
4 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2024-07-18 17:17 UTC (permalink / raw)
To: Hector Palacios
Cc: Pengutronix Kernel Team, NXP Linux Team, linux-gpio,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
linux-kernel
Hi Hector,
thank you for working on this.
Do you plan to submit a new version of this?
Regards Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-07-18 17:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 9:44 [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Hector Palacios
2024-01-17 9:44 ` [PATCH v4 1/3] gpio: vf610: add support to DT 'ngpios' property Hector Palacios
2024-01-17 20:53 ` Andy Shevchenko
2024-01-17 9:44 ` [PATCH v4 2/3] dt-bindings: gpio: vf610: add optional 'ngpios' Hector Palacios
2024-01-17 10:09 ` Krzysztof Kozlowski
2024-01-17 9:44 ` [PATCH v4 3/3] arm64: dts: imx93: specify available 'ngpios' per GPIO port Hector Palacios
2024-01-17 10:04 ` [PATCH v4 0/3] gpio: support i.MX93 truly available GPIO pins Bartosz Golaszewski
2024-07-18 17:17 ` Stefan Wahren
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).