* [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers
@ 2026-04-27 10:14 Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 1/4] ARM: pxa: statify platform device definitions in spitz board file Bartosz Golaszewski
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:14 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Dmitry Torokhov, Arnd Bergmann, Linus Walleij
Cc: brgl, linux-arm-kernel, linux-gpio, linux-kernel,
Bartosz Golaszewski
Convert GPIO controllers and their consumers on the PXA platform to using
"attached" software nodes. Since everything happens in a bord-file, it's
quite straightforward. We technically now have a way of passing an
unregistered software node to platform_device_register_full() but that
requires using struct platform_device_info and since the existing
platform devices are either referenced from other places or defined in a
different compilation unit, I wanted to reduce the impact of the changes
I can't test and went with the older method.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v2:
- Rebase on top of v7.1-rc1
- Add a patch making some platform device definitions static
- Link to v1: https://patch.msgid.link/20260331-pxa-gpio-swnodes-v1-0-f66d86d10d8d@oss.qualcomm.com
---
Bartosz Golaszewski (4):
ARM: pxa: statify platform device definitions in spitz board file
ARM: pxa: spitz: attach software nodes to their target GPIO controllers
ARM: pxa: pxa25x: attach software node to its target GPIO controller
ARM: pxa: pxa27x: attach software node to its target GPIO controller
arch/arm/mach-pxa/pxa25x.c | 5 ++++-
arch/arm/mach-pxa/pxa27x.c | 5 ++++-
arch/arm/mach-pxa/spitz.c | 11 ++++++++---
3 files changed, 16 insertions(+), 5 deletions(-)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260330-pxa-gpio-swnodes-132a81af10e3
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/4] ARM: pxa: statify platform device definitions in spitz board file
2026-04-27 10:14 [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Bartosz Golaszewski
@ 2026-04-27 10:14 ` Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 2/4] ARM: pxa: spitz: attach software nodes to their target GPIO controllers Bartosz Golaszewski
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:14 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Dmitry Torokhov, Arnd Bergmann, Linus Walleij
Cc: brgl, linux-arm-kernel, linux-gpio, linux-kernel,
Bartosz Golaszewski
The scoop devices are not used outside of this board file so make them
static.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/arm/mach-pxa/spitz.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index c0b1f7e6be87411359b0020257ff12c73bbcbae3..3284b9f62be970555042a7292993e45d56fde47e 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -165,7 +165,7 @@ static struct scoop_config spitz_scoop_1_setup = {
.gpio_base = SPITZ_SCP_GPIO_BASE,
};
-struct platform_device spitz_scoop_1_device = {
+static struct platform_device spitz_scoop_1_device = {
.name = "sharp-scoop",
.id = 0,
.dev = {
@@ -192,7 +192,7 @@ static struct scoop_config spitz_scoop_2_setup = {
.gpio_base = SPITZ_SCP2_GPIO_BASE,
};
-struct platform_device spitz_scoop_2_device = {
+static struct platform_device spitz_scoop_2_device = {
.name = "sharp-scoop",
.id = 1,
.dev = {
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] ARM: pxa: spitz: attach software nodes to their target GPIO controllers
2026-04-27 10:14 [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 1/4] ARM: pxa: statify platform device definitions in spitz board file Bartosz Golaszewski
@ 2026-04-27 10:14 ` Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 3/4] ARM: pxa: pxa25x: attach software node to its target GPIO controller Bartosz Golaszewski
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:14 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Dmitry Torokhov, Arnd Bergmann, Linus Walleij
Cc: brgl, linux-arm-kernel, linux-gpio, linux-kernel,
Bartosz Golaszewski
Software nodes describing the GPIO controllers for the spitz platform
are currently "dangling" - they're not actually attached to the relevant
controllers and don't allow real fwnode lookup. Attach them either by
directly assigning them to the struct device or by using the i2c board
info struct.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/arm/mach-pxa/spitz.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 3284b9f62be970555042a7292993e45d56fde47e..5091b601c4e1bf25cfee07429881894929853dfe 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -204,11 +204,15 @@ static struct platform_device spitz_scoop_2_device = {
static void __init spitz_scoop_init(void)
{
+ spitz_scoop_1_device.dev.fwnode = software_node_fwnode(&spitz_scoop_1_gpiochip_node);
platform_device_register(&spitz_scoop_1_device);
/* Akita doesn't have the second SCOOP chip */
- if (!machine_is_akita())
+ if (!machine_is_akita()) {
+ spitz_scoop_2_device.dev.fwnode = software_node_fwnode(
+ &spitz_scoop_2_gpiochip_node);
platform_device_register(&spitz_scoop_2_device);
+ }
}
/* Power control is shared with between one of the CF slots and SD */
@@ -988,6 +992,7 @@ static struct i2c_board_info spitz_i2c_devs[] = {
.type = "max7310",
.addr = 0x18,
.platform_data = &akita_pca953x_pdata,
+ .swnode = &akita_max7310_gpiochip_node,
},
};
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] ARM: pxa: pxa25x: attach software node to its target GPIO controller
2026-04-27 10:14 [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 1/4] ARM: pxa: statify platform device definitions in spitz board file Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 2/4] ARM: pxa: spitz: attach software nodes to their target GPIO controllers Bartosz Golaszewski
@ 2026-04-27 10:14 ` Bartosz Golaszewski
2026-04-27 10:58 ` Russell King (Oracle)
2026-04-27 10:14 ` [PATCH v2 4/4] ARM: pxa: pxa27x: " Bartosz Golaszewski
2026-04-27 10:49 ` [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Arnd Bergmann
4 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:14 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Dmitry Torokhov, Arnd Bergmann, Linus Walleij
Cc: brgl, linux-arm-kernel, linux-gpio, linux-kernel,
Bartosz Golaszewski
Software node describing the GPIO controller for the pxa25x platforms is
currently "dangling" - it's not actually attached to the relevant
controller and doesn't allow real fwnode lookup. Attach it once it's
registered as a firmware node before adding the platform device.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/arm/mach-pxa/pxa25x.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 70509a5998142ec6b9c484e5f094751eda6db6cd..6875774f2cae1db4798d18c813f445bdc31b15de 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -179,7 +179,6 @@ void __init pxa25x_map_io(void)
}
static struct platform_device *pxa25x_devices[] __initdata = {
- &pxa25x_device_gpio,
&pxa25x_device_udc,
&pxa_device_pmu,
&pxa_device_i2s,
@@ -240,6 +239,10 @@ static int __init pxa25x_init(void)
if (!of_have_populated_dt()) {
software_node_register(&pxa2xx_gpiochip_node);
+ pxa25x_device_gpio.dev.fwnode = software_node_fwnode(
+ &pxa2xx_gpiochip_node);
+ platform_device_register(&pxa25x_device_gpio);
+
pxa2xx_set_dmac_info(&pxa25x_dma_pdata);
ret = platform_add_devices(pxa25x_devices,
ARRAY_SIZE(pxa25x_devices));
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] ARM: pxa: pxa27x: attach software node to its target GPIO controller
2026-04-27 10:14 [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Bartosz Golaszewski
` (2 preceding siblings ...)
2026-04-27 10:14 ` [PATCH v2 3/4] ARM: pxa: pxa25x: attach software node to its target GPIO controller Bartosz Golaszewski
@ 2026-04-27 10:14 ` Bartosz Golaszewski
2026-04-27 10:49 ` [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Arnd Bergmann
4 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:14 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Dmitry Torokhov, Arnd Bergmann, Linus Walleij
Cc: brgl, linux-arm-kernel, linux-gpio, linux-kernel,
Bartosz Golaszewski
Software node describing the GPIO controller for the pxa27x platforms is
currently "dangling" - it's not actually attached to the relevant
controller and doesn't allow real fwnode lookup. Attach it once it's
registered as a firmware node before adding the platform device.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/arm/mach-pxa/pxa27x.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index ff63619790383859ba111e3efe7619aa6cbd248e..bacfd50939fd447ffa11d398867dea7fa638988b 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -277,7 +277,6 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
}
static struct platform_device *devices[] __initdata = {
- &pxa27x_device_gpio,
&pxa27x_device_udc,
&pxa_device_pmu,
&pxa_device_i2s,
@@ -342,6 +341,10 @@ static int __init pxa27x_init(void)
if (!of_have_populated_dt()) {
software_node_register(&pxa2xx_gpiochip_node);
+ pxa27x_device_gpio.dev.fwnode = software_node_fwnode(
+ &pxa2xx_gpiochip_node);
+ platform_device_register(&pxa27x_device_gpio);
+
pxa2xx_set_dmac_info(&pxa27x_dma_pdata);
ret = platform_add_devices(devices,
ARRAY_SIZE(devices));
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers
2026-04-27 10:14 [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Bartosz Golaszewski
` (3 preceding siblings ...)
2026-04-27 10:14 ` [PATCH v2 4/4] ARM: pxa: pxa27x: " Bartosz Golaszewski
@ 2026-04-27 10:49 ` Arnd Bergmann
2026-04-27 11:01 ` Bartosz Golaszewski
4 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2026-04-27 10:49 UTC (permalink / raw)
To: Bartosz Golaszewski, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Russell King, Dmitry Torokhov, Linus Walleij
Cc: Bartosz Golaszewski, linux-arm-kernel, open list:GPIO SUBSYSTEM,
linux-kernel
On Mon, Apr 27, 2026, at 12:14, Bartosz Golaszewski wrote:
> Convert GPIO controllers and their consumers on the PXA platform to using
> "attached" software nodes. Since everything happens in a bord-file, it's
> quite straightforward. We technically now have a way of passing an
> unregistered software node to platform_device_register_full() but that
> requires using struct platform_device_info and since the existing
> platform devices are either referenced from other places or defined in a
> different compilation unit, I wanted to reduce the impact of the changes
> I can't test and went with the older method.
>
> Signed-off-by: Bartosz Golaszewski
> <bartosz.golaszewski@oss.qualcomm.com>
> ---
Hi Bartosz,
These patches are individually all fine, but I was hoping to
finally get around to removing the pxa board files completely,
sorry it's been taking me so long to rebase my series for
that.
The only remaining board files I expect to have soon are for
the omap1 and s3c machines, so if you are going through the
board files to convert them to over, I would suggest focusing
on those.
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/4] ARM: pxa: pxa25x: attach software node to its target GPIO controller
2026-04-27 10:14 ` [PATCH v2 3/4] ARM: pxa: pxa25x: attach software node to its target GPIO controller Bartosz Golaszewski
@ 2026-04-27 10:58 ` Russell King (Oracle)
0 siblings, 0 replies; 8+ messages in thread
From: Russell King (Oracle) @ 2026-04-27 10:58 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Dmitry Torokhov,
Arnd Bergmann, Linus Walleij, brgl, linux-arm-kernel, linux-gpio,
linux-kernel
On Mon, Apr 27, 2026 at 12:14:34PM +0200, Bartosz Golaszewski wrote:
> Software node describing the GPIO controller for the pxa25x platforms is
> currently "dangling" - it's not actually attached to the relevant
> controller and doesn't allow real fwnode lookup. Attach it once it's
> registered as a firmware node before adding the platform device.
>
> Reviewed-by: Linus Walleij <linusw@kernel.org>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
> arch/arm/mach-pxa/pxa25x.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
> index 70509a5998142ec6b9c484e5f094751eda6db6cd..6875774f2cae1db4798d18c813f445bdc31b15de 100644
> --- a/arch/arm/mach-pxa/pxa25x.c
> +++ b/arch/arm/mach-pxa/pxa25x.c
> @@ -179,7 +179,6 @@ void __init pxa25x_map_io(void)
> }
>
> static struct platform_device *pxa25x_devices[] __initdata = {
> - &pxa25x_device_gpio,
> &pxa25x_device_udc,
> &pxa_device_pmu,
> &pxa_device_i2s,
> @@ -240,6 +239,10 @@ static int __init pxa25x_init(void)
>
> if (!of_have_populated_dt()) {
> software_node_register(&pxa2xx_gpiochip_node);
> + pxa25x_device_gpio.dev.fwnode = software_node_fwnode(
> + &pxa2xx_gpiochip_node);
> + platform_device_register(&pxa25x_device_gpio);
> +
> pxa2xx_set_dmac_info(&pxa25x_dma_pdata);
> ret = platform_add_devices(pxa25x_devices,
> ARRAY_SIZE(pxa25x_devices));
Why do you need to explicitly register using platform_device_register()
rather than leaving the device in the pxa25x_devices list and letting
platform_add_devices() do that for you? platform_add_devices() is just
a wrapper around platform_device_register() which calls that for all
devices in the array.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers
2026-04-27 10:49 ` [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Arnd Bergmann
@ 2026-04-27 11:01 ` Bartosz Golaszewski
0 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 11:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Bartosz Golaszewski, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Russell King, Dmitry Torokhov, Linus Walleij, linux-arm-kernel,
open list:GPIO SUBSYSTEM, linux-kernel
On Mon, Apr 27, 2026 at 12:50 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Mon, Apr 27, 2026, at 12:14, Bartosz Golaszewski wrote:
> > Convert GPIO controllers and their consumers on the PXA platform to using
> > "attached" software nodes. Since everything happens in a bord-file, it's
> > quite straightforward. We technically now have a way of passing an
> > unregistered software node to platform_device_register_full() but that
> > requires using struct platform_device_info and since the existing
> > platform devices are either referenced from other places or defined in a
> > different compilation unit, I wanted to reduce the impact of the changes
> > I can't test and went with the older method.
> >
> > Signed-off-by: Bartosz Golaszewski
> > <bartosz.golaszewski@oss.qualcomm.com>
> > ---
>
> Hi Bartosz,
>
> These patches are individually all fine, but I was hoping to
> finally get around to removing the pxa board files completely,
> sorry it's been taking me so long to rebase my series for
> that.
>
If that'll be queued for v7.2, then I'm fine with dropping this
series. Otherwise, I'd like to see it applied as I want to get all the
changes required to remove the software node name matching from
GPIOLIB into v7.2 and then finally remove it in v7.3.
> The only remaining board files I expect to have soon are for
> the omap1 and s3c machines, so if you are going through the
> board files to convert them to over, I would suggest focusing
> on those.
>
S3C does not seem to need any changes, I already sent out a series for omap1.
Bart
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-04-27 11:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 10:14 [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 1/4] ARM: pxa: statify platform device definitions in spitz board file Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 2/4] ARM: pxa: spitz: attach software nodes to their target GPIO controllers Bartosz Golaszewski
2026-04-27 10:14 ` [PATCH v2 3/4] ARM: pxa: pxa25x: attach software node to its target GPIO controller Bartosz Golaszewski
2026-04-27 10:58 ` Russell King (Oracle)
2026-04-27 10:14 ` [PATCH v2 4/4] ARM: pxa: pxa27x: " Bartosz Golaszewski
2026-04-27 10:49 ` [PATCH v2 0/4] ARM: pxa: attach software nodes to the GPIO controllers Arnd Bergmann
2026-04-27 11:01 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox