public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v6 0/3] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770
@ 2026-04-27 10:46 Bartosz Golaszewski
  2026-04-27 10:46 ` [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init() Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
	Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
  Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
	linux-omap, Bartosz Golaszewski

This converts Nokia 770 to using real firmware node lookup for GPIOs by
attaching the software nodes describing GPIO controllers to their target
devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v6:
- Switch to using platform_device_register_full() and pass the software
  node via the swnode field of struct platform_device_info
- Drop driver-core prerequisites from the series
- Rebase on top of v7.1-rc1
- Add patch dropping an unused variable
- Link to v5: https://patch.msgid.link/20260402-nokia770-gpio-swnodes-v5-0-d730db3dd299@oss.qualcomm.com

Changes in v5:
- Put ksysfs_init() in a separate new header
- Remove software_node_exit() in a separate patch
- Link to v4: https://patch.msgid.link/20260330-nokia770-gpio-swnodes-v4-0-b68592e977d0@oss.qualcomm.com

Changes in v4:
- Add patches making software nodes available earlier
- Remove stray newline
- Link to v3: https://lore.kernel.org/all/20260212112508.73500-1-bartosz.golaszewski@oss.qualcomm.com/

Changes in v3:
- fix references to the MPU node

Changes in v2:
- fix build with CONFIG_I2C_CBUS_GPIO
- only export the two symbols that are actually required by the nokia
  board file

---
Bartosz Golaszewski (3):
      ARM: omap1: drop unused variable from omap16xx_gpio_init()
      ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
      ARM: omap1: enable real software node lookup of GPIOs on Nokia 770

 arch/arm/mach-omap1/board-nokia770.c | 30 +++-----------
 arch/arm/mach-omap1/common.h         |  3 ++
 arch/arm/mach-omap1/gpio16xx.c       | 77 ++++++++++++++++++------------------
 3 files changed, 47 insertions(+), 63 deletions(-)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260330-nokia770-gpio-swnodes-5da8ba35946e

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init()
  2026-04-27 10:46 [PATCH v6 0/3] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
@ 2026-04-27 10:46 ` Bartosz Golaszewski
  2026-04-27 10:52   ` Arnd Bergmann
  2026-04-27 10:46 ` [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx Bartosz Golaszewski
  2026-04-27 10:46 ` [PATCH v6 3/3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
  2 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
	Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
  Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
	linux-omap, Bartosz Golaszewski

The pdata variable is set but not used. Remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 arch/arm/mach-omap1/gpio16xx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 55acec22fef4e73f20935473602ef6cb2f4f379c..e8dbe173bd33fae72c7c884f930a530f78096839 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -212,7 +212,6 @@ static int __init omap16xx_gpio_init(void)
 	void __iomem *base;
 	struct resource *res;
 	struct platform_device *pdev;
-	struct omap_gpio_platform_data *pdata;
 
 	if (!cpu_is_omap16xx())
 		return -EINVAL;
@@ -226,7 +225,6 @@ static int __init omap16xx_gpio_init(void)
 
 	for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
 		pdev = omap16xx_gpio_dev[i];
-		pdata = pdev->dev.platform_data;
 
 		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 		if (unlikely(!res)) {

-- 
2.47.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  2026-04-27 10:46 [PATCH v6 0/3] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
  2026-04-27 10:46 ` [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init() Bartosz Golaszewski
@ 2026-04-27 10:46 ` Bartosz Golaszewski
  2026-04-27 10:50   ` Arnd Bergmann
  2026-04-27 14:43   ` Andy Shevchenko
  2026-04-27 10:46 ` [PATCH v6 3/3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
  2 siblings, 2 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
	Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
  Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
	linux-omap, Bartosz Golaszewski

Ahead of changes attaching GPIO controller's software nodes referenced
from the Nokia 770 board files to their target devices, switch the
method for registering the platform devices to the
platform_device_register_full() variant. This is done to leverage the
new swnode field of struct platform_device_info which automate the
software node's registration and assignment.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 arch/arm/mach-omap1/gpio16xx.c | 68 ++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index e8dbe173bd33fae72c7c884f930a530f78096839..2904ce38c001505d48d0996f7053369bbf683209 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -55,14 +55,13 @@ static struct omap_gpio_platform_data omap16xx_mpu_gpio_config = {
 	.regs                   = &omap16xx_mpuio_regs,
 };
 
-static struct platform_device omap16xx_mpu_gpio = {
+static const struct platform_device_info omap16xx_mpu_gpio = {
 	.name           = "omap_gpio",
 	.id             = 0,
-	.dev            = {
-		.platform_data = &omap16xx_mpu_gpio_config,
-	},
-	.num_resources = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
-	.resource = omap16xx_mpu_gpio_resources,
+	.data           = &omap16xx_mpu_gpio_config,
+	.size_data      = sizeof(omap16xx_mpu_gpio_config),
+	.num_res        = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
+	.res            = omap16xx_mpu_gpio_resources,
 };
 
 /* gpio1 */
@@ -99,14 +98,13 @@ static struct omap_gpio_platform_data omap16xx_gpio1_config = {
 	.regs                   = &omap16xx_gpio_regs,
 };
 
-static struct platform_device omap16xx_gpio1 = {
+static const struct platform_device_info omap16xx_gpio1 = {
 	.name           = "omap_gpio",
 	.id             = 1,
-	.dev            = {
-		.platform_data = &omap16xx_gpio1_config,
-	},
-	.num_resources = ARRAY_SIZE(omap16xx_gpio1_resources),
-	.resource = omap16xx_gpio1_resources,
+	.data           = &omap16xx_gpio1_config,
+	.size_data      = sizeof(omap16xx_gpio1_config),
+	.num_res        = ARRAY_SIZE(omap16xx_gpio1_resources),
+	.res            = omap16xx_gpio1_resources,
 };
 
 /* gpio2 */
@@ -127,14 +125,13 @@ static struct omap_gpio_platform_data omap16xx_gpio2_config = {
 	.regs                   = &omap16xx_gpio_regs,
 };
 
-static struct platform_device omap16xx_gpio2 = {
+static const struct platform_device_info omap16xx_gpio2 = {
 	.name           = "omap_gpio",
 	.id             = 2,
-	.dev            = {
-		.platform_data = &omap16xx_gpio2_config,
-	},
-	.num_resources = ARRAY_SIZE(omap16xx_gpio2_resources),
-	.resource = omap16xx_gpio2_resources,
+	.data           = &omap16xx_gpio2_config,
+	.size_data      = sizeof(omap16xx_gpio2_config),
+	.num_res        = ARRAY_SIZE(omap16xx_gpio2_resources),
+	.res            = omap16xx_gpio2_resources,
 };
 
 /* gpio3 */
@@ -155,14 +152,13 @@ static struct omap_gpio_platform_data omap16xx_gpio3_config = {
 	.regs                   = &omap16xx_gpio_regs,
 };
 
-static struct platform_device omap16xx_gpio3 = {
+static const struct platform_device_info omap16xx_gpio3 = {
 	.name           = "omap_gpio",
 	.id             = 3,
-	.dev            = {
-		.platform_data = &omap16xx_gpio3_config,
-	},
-	.num_resources = ARRAY_SIZE(omap16xx_gpio3_resources),
-	.resource = omap16xx_gpio3_resources,
+	.data           = &omap16xx_gpio3_config,
+	.size_data      = sizeof(omap16xx_gpio3_config),
+	.num_res        = ARRAY_SIZE(omap16xx_gpio3_resources),
+	.res            = omap16xx_gpio3_resources,
 };
 
 /* gpio4 */
@@ -183,17 +179,16 @@ static struct omap_gpio_platform_data omap16xx_gpio4_config = {
 	.regs                   = &omap16xx_gpio_regs,
 };
 
-static struct platform_device omap16xx_gpio4 = {
+static const struct platform_device_info omap16xx_gpio4 = {
 	.name           = "omap_gpio",
 	.id             = 4,
-	.dev            = {
-		.platform_data = &omap16xx_gpio4_config,
-	},
-	.num_resources = ARRAY_SIZE(omap16xx_gpio4_resources),
-	.resource = omap16xx_gpio4_resources,
+	.data           = &omap16xx_gpio4_config,
+	.size_data      = sizeof(omap16xx_gpio4_config),
+	.num_res        = ARRAY_SIZE(omap16xx_gpio4_resources),
+	.res            = omap16xx_gpio4_resources,
 };
 
-static struct platform_device *omap16xx_gpio_dev[] __initdata = {
+static const struct platform_device_info *omap16xx_gpio_dev[] __initconst = {
 	&omap16xx_mpu_gpio,
 	&omap16xx_gpio1,
 	&omap16xx_gpio2,
@@ -210,8 +205,9 @@ static int __init omap16xx_gpio_init(void)
 {
 	int i;
 	void __iomem *base;
-	struct resource *res;
+	const struct resource *res;
 	struct platform_device *pdev;
+	const struct platform_device_info *pdevinfo;
 
 	if (!cpu_is_omap16xx())
 		return -EINVAL;
@@ -224,9 +220,9 @@ static int __init omap16xx_gpio_init(void)
 					ULPD_CAM_CLK_CTRL);
 
 	for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
-		pdev = omap16xx_gpio_dev[i];
+		pdevinfo = omap16xx_gpio_dev[i];
 
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+		res = &pdevinfo->res[0];
 		if (unlikely(!res)) {
 			dev_err(&pdev->dev, "Invalid mem resource.\n");
 			return -ENODEV;
@@ -234,14 +230,14 @@ static int __init omap16xx_gpio_init(void)
 
 		base = ioremap(res->start, resource_size(res));
 		if (unlikely(!base)) {
-			dev_err(&pdev->dev, "ioremap failed.\n");
+			pr_err("ioremap failed.\n");
 			return -ENOMEM;
 		}
 
 		__raw_writel(SYSCONFIG_WORD, base + OMAP1610_GPIO_SYSCONFIG);
 		iounmap(base);
 
-		platform_device_register(omap16xx_gpio_dev[i]);
+		platform_device_register_full(omap16xx_gpio_dev[i]);
 	}
 
 	return 0;

-- 
2.47.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v6 3/3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
  2026-04-27 10:46 [PATCH v6 0/3] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
  2026-04-27 10:46 ` [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init() Bartosz Golaszewski
  2026-04-27 10:46 ` [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx Bartosz Golaszewski
@ 2026-04-27 10:46 ` Bartosz Golaszewski
  2026-04-27 14:52   ` Andy Shevchenko
  2 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 10:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
	Dmitry Torokhov, Kevin Hilman, Arnd Bergmann
  Cc: brgl, driver-core, linux-kernel, linux-acpi, linux-arm-kernel,
	linux-omap, Bartosz Golaszewski

Currently the board file for Nokia 770 creates dummy software nodes not
attached in any way to the actual GPIO controller devices and uses the
fact that GPIOLIB matching swnode's name to the GPIO chip's label during
software node lookup. This behavior is wrong and we want to remove it.
To that end, we need to first convert all existing users to creating
actual fwnode links.

Create real software nodes for GPIO controllers on OMAP16xx and
reference them from the software nodes in the nokia board file.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 arch/arm/mach-omap1/board-nokia770.c | 30 +++++-------------------------
 arch/arm/mach-omap1/common.h         |  3 +++
 arch/arm/mach-omap1/gpio16xx.c       |  7 +++++++
 3 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index a5bf5554800fe17b430e84ae421ffa8da2bb11a0..46f817f6316b70ff37bb9dfde86c675fd692999b 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -36,25 +36,6 @@
 #include "clock.h"
 #include "mmc.h"
 
-static const struct software_node nokia770_mpuio_gpiochip_node = {
-	.name = "mpuio",
-};
-
-static const struct software_node nokia770_gpiochip1_node = {
-	.name = "gpio-0-15",
-};
-
-static const struct software_node nokia770_gpiochip2_node = {
-	.name = "gpio-16-31",
-};
-
-static const struct software_node *nokia770_gpiochip_nodes[] = {
-	&nokia770_mpuio_gpiochip_node,
-	&nokia770_gpiochip1_node,
-	&nokia770_gpiochip2_node,
-	NULL
-};
-
 #define ADS7846_PENDOWN_GPIO	15
 
 static const unsigned int nokia770_keymap[] = {
@@ -112,7 +93,7 @@ static const struct omap_lcd_config nokia770_lcd_config __initconst = {
 };
 
 static const struct property_entry nokia770_mipid_props[] = {
-	PROPERTY_ENTRY_GPIO("reset-gpios", &nokia770_gpiochip1_node,
+	PROPERTY_ENTRY_GPIO("reset-gpios", &omap16xx_gpio1_swnode,
 			    13, GPIO_ACTIVE_LOW),
 	{ }
 };
@@ -138,7 +119,7 @@ static const struct property_entry nokia770_ads7846_props[] = {
 	PROPERTY_ENTRY_U16("ti,x-plate-ohms", 180),
 	PROPERTY_ENTRY_U16("ti,debounce-tol", 3),
 	PROPERTY_ENTRY_U16("ti,debounce-rep", 1),
-	PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node,
+	PROPERTY_ENTRY_GPIO("pendown-gpios", &omap16xx_gpio1_swnode,
 			    ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_LOW),
 	{ }
 };
@@ -225,9 +206,9 @@ static inline void nokia770_mmc_init(void)
 #if IS_ENABLED(CONFIG_I2C_CBUS_GPIO)
 
 static const struct software_node_ref_args nokia770_cbus_gpio_refs[] = {
-	SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 9, 0),
-	SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 10, 0),
-	SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 11, 0),
+	SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 9, 0),
+	SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 10, 0),
+	SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 11, 0),
 };
 
 static const struct property_entry nokia770_cbus_props[] = {
@@ -318,7 +299,6 @@ static void __init omap_nokia770_init(void)
 	/* Unmask SleepX signal */
 	omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
 
-	software_node_register_node_group(nokia770_gpiochip_nodes);
 	platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
 
 	gpiod_add_lookup_table(&nokia770_irq_gpio_table);
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index 7a7c3d9eb84a06c18fbc70e7c94a161b487cd002..c0f6e231fdb4422c5d2c1aa3e33dd6dd99d2710e 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -35,6 +35,9 @@
 #include "soc.h"
 #include "i2c.h"
 
+extern const struct software_node omap16xx_mpu_gpio_swnode;
+extern const struct software_node omap16xx_gpio1_swnode;
+
 #ifdef CONFIG_OMAP_SERIAL_WAKE
 int omap_serial_wakeup_init(void);
 #else
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 2904ce38c001505d48d0996f7053369bbf683209..abc71bb562df18fb1f683c6f216c698a38cf09a9 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/platform_data/gpio-omap.h>
+#include <linux/property.h>
 #include <linux/soc/ti/omap1-io.h>
 
 #include "hardware.h"
@@ -55,6 +56,8 @@ static struct omap_gpio_platform_data omap16xx_mpu_gpio_config = {
 	.regs                   = &omap16xx_mpuio_regs,
 };
 
+const struct software_node omap16xx_mpu_gpio_swnode = { };
+
 static const struct platform_device_info omap16xx_mpu_gpio = {
 	.name           = "omap_gpio",
 	.id             = 0,
@@ -62,6 +65,7 @@ static const struct platform_device_info omap16xx_mpu_gpio = {
 	.size_data      = sizeof(omap16xx_mpu_gpio_config),
 	.num_res        = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
 	.res            = omap16xx_mpu_gpio_resources,
+	.swnode         = &omap16xx_mpu_gpio_swnode,
 };
 
 /* gpio1 */
@@ -98,6 +102,8 @@ static struct omap_gpio_platform_data omap16xx_gpio1_config = {
 	.regs                   = &omap16xx_gpio_regs,
 };
 
+const struct software_node omap16xx_gpio1_swnode = { };
+
 static const struct platform_device_info omap16xx_gpio1 = {
 	.name           = "omap_gpio",
 	.id             = 1,
@@ -105,6 +111,7 @@ static const struct platform_device_info omap16xx_gpio1 = {
 	.size_data      = sizeof(omap16xx_gpio1_config),
 	.num_res        = ARRAY_SIZE(omap16xx_gpio1_resources),
 	.res            = omap16xx_gpio1_resources,
+	.swnode         = &omap16xx_gpio1_swnode,
 };
 
 /* gpio2 */

-- 
2.47.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  2026-04-27 10:46 ` [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx Bartosz Golaszewski
@ 2026-04-27 10:50   ` Arnd Bergmann
  2026-04-27 14:43   ` Andy Shevchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2026-04-27 10:50 UTC (permalink / raw)
  To: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J . Wysocki,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Sakari Ailus, Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
	Russell King, Dmitry Torokhov, Kevin Hilman
  Cc: Bartosz Golaszewski, driver-core, linux-kernel, linux-acpi,
	linux-arm-kernel, Linux-OMAP

On Mon, Apr 27, 2026, at 12:46, Bartosz Golaszewski wrote:
> Ahead of changes attaching GPIO controller's software nodes referenced
> from the Nokia 770 board files to their target devices, switch the
> method for registering the platform devices to the
> platform_device_register_full() variant. This is done to leverage the
> new swnode field of struct platform_device_info which automate the
> software node's registration and assignment.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init()
  2026-04-27 10:46 ` [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init() Bartosz Golaszewski
@ 2026-04-27 10:52   ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2026-04-27 10:52 UTC (permalink / raw)
  To: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J . Wysocki,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Sakari Ailus, Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
	Russell King, Dmitry Torokhov, Kevin Hilman
  Cc: Bartosz Golaszewski, driver-core, linux-kernel, linux-acpi,
	linux-arm-kernel, Linux-OMAP

On Mon, Apr 27, 2026, at 12:46, Bartosz Golaszewski wrote:
> The pdata variable is set but not used. Remove it.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  arch/arm/mach-omap1/gpio16xx.c | 2 --

Reviewed-by: Arnd Bergmann <arnd@arndb.de>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  2026-04-27 10:46 ` [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx Bartosz Golaszewski
  2026-04-27 10:50   ` Arnd Bergmann
@ 2026-04-27 14:43   ` Andy Shevchenko
  2026-04-27 14:47     ` Andy Shevchenko
  2026-04-27 14:48     ` Bartosz Golaszewski
  1 sibling, 2 replies; 10+ messages in thread
From: Andy Shevchenko @ 2026-04-27 14:43 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
	Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
	Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
	linux-acpi, linux-arm-kernel, linux-omap

On Mon, Apr 27, 2026 at 12:46:33PM +0200, Bartosz Golaszewski wrote:
> Ahead of changes attaching GPIO controller's software nodes referenced
> from the Nokia 770 board files to their target devices, switch the
> method for registering the platform devices to the
> platform_device_register_full() variant. This is done to leverage the
> new swnode field of struct platform_device_info which automate the
> software node's registration and assignment.

...

>  	for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
> -		pdev = omap16xx_gpio_dev[i];
> +		pdevinfo = omap16xx_gpio_dev[i];
>  
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +		res = &pdevinfo->res[0];
>  		if (unlikely(!res)) {
>  			dev_err(&pdev->dev, "Invalid mem resource.\n");
>  			return -ENODEV;

>  		base = ioremap(res->start, resource_size(res));
>  		if (unlikely(!base)) {
> -			dev_err(&pdev->dev, "ioremap failed.\n");
> +			pr_err("ioremap failed.\n");
>  			return -ENOMEM;
>  		}

Isn't this a stray change? Or why then? And why the previous dev_err() is left untouched?

>  		__raw_writel(SYSCONFIG_WORD, base + OMAP1610_GPIO_SYSCONFIG);
>  		iounmap(base);
>  
> -		platform_device_register(omap16xx_gpio_dev[i]);
> +		platform_device_register_full(omap16xx_gpio_dev[i]);
>  	}

-- 
With Best Regards,
Andy Shevchenko




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  2026-04-27 14:43   ` Andy Shevchenko
@ 2026-04-27 14:47     ` Andy Shevchenko
  2026-04-27 14:48     ` Bartosz Golaszewski
  1 sibling, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2026-04-27 14:47 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
	Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
	Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
	linux-acpi, linux-arm-kernel, linux-omap

On Mon, Apr 27, 2026 at 05:44:05PM +0300, Andy Shevchenko wrote:
> On Mon, Apr 27, 2026 at 12:46:33PM +0200, Bartosz Golaszewski wrote:

...

> >  	for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
> > -		pdev = omap16xx_gpio_dev[i];
> > +		pdevinfo = omap16xx_gpio_dev[i];
> >  
> > -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +		res = &pdevinfo->res[0];
> >  		if (unlikely(!res)) {
> >  			dev_err(&pdev->dev, "Invalid mem resource.\n");
> >  			return -ENODEV;
> 
> >  		base = ioremap(res->start, resource_size(res));
> >  		if (unlikely(!base)) {
> > -			dev_err(&pdev->dev, "ioremap failed.\n");
> > +			pr_err("ioremap failed.\n");
> >  			return -ENOMEM;
> >  		}
> 
> Isn't this a stray change? Or why then? And why the previous dev_err() is left untouched?

If you go with pr_*(), please use ->name and ->id from pdevinfo to make it on par with the
previously called dev_err(). Perhaps even pr_fmt() on top of that (on top of the file).

> >  		__raw_writel(SYSCONFIG_WORD, base + OMAP1610_GPIO_SYSCONFIG);
> >  		iounmap(base);
> >  
> > -		platform_device_register(omap16xx_gpio_dev[i]);
> > +		platform_device_register_full(omap16xx_gpio_dev[i]);
> >  	}

-- 
With Best Regards,
Andy Shevchenko




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  2026-04-27 14:43   ` Andy Shevchenko
  2026-04-27 14:47     ` Andy Shevchenko
@ 2026-04-27 14:48     ` Bartosz Golaszewski
  1 sibling, 0 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-04-27 14:48 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren, Russell King,
	Dmitry Torokhov, Kevin Hilman, Arnd Bergmann, driver-core,
	linux-kernel, linux-acpi, linux-arm-kernel, linux-omap

On Mon, Apr 27, 2026 at 4:44 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Mon, Apr 27, 2026 at 12:46:33PM +0200, Bartosz Golaszewski wrote:
> > Ahead of changes attaching GPIO controller's software nodes referenced
> > from the Nokia 770 board files to their target devices, switch the
> > method for registering the platform devices to the
> > platform_device_register_full() variant. This is done to leverage the
> > new swnode field of struct platform_device_info which automate the
> > software node's registration and assignment.
>
> ...
>
> >       for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
> > -             pdev = omap16xx_gpio_dev[i];
> > +             pdevinfo = omap16xx_gpio_dev[i];
> >
> > -             res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +             res = &pdevinfo->res[0];
> >               if (unlikely(!res)) {
> >                       dev_err(&pdev->dev, "Invalid mem resource.\n");
> >                       return -ENODEV;
>
> >               base = ioremap(res->start, resource_size(res));
> >               if (unlikely(!base)) {
> > -                     dev_err(&pdev->dev, "ioremap failed.\n");
> > +                     pr_err("ioremap failed.\n");
> >                       return -ENOMEM;
> >               }
>
> Isn't this a stray change? Or why then? And why the previous dev_err() is left untouched?
>

We need this because we no longer have a struct device to pass to
dev_err() before calling platform_device_register_full(). And you're
right about the other instance of dev_err(), thanks.

Bart


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v6 3/3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
  2026-04-27 10:46 ` [PATCH v6 3/3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
@ 2026-04-27 14:52   ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2026-04-27 14:52 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Aaro Koskinen,
	Janusz Krzysztofik, Tony Lindgren, Russell King, Dmitry Torokhov,
	Kevin Hilman, Arnd Bergmann, brgl, driver-core, linux-kernel,
	linux-acpi, linux-arm-kernel, linux-omap

On Mon, Apr 27, 2026 at 12:46:34PM +0200, Bartosz Golaszewski wrote:
> Currently the board file for Nokia 770 creates dummy software nodes not
> attached in any way to the actual GPIO controller devices and uses the
> fact that GPIOLIB matching swnode's name to the GPIO chip's label during
> software node lookup. This behavior is wrong and we want to remove it.
> To that end, we need to first convert all existing users to creating
> actual fwnode links.
> 
> Create real software nodes for GPIO controllers on OMAP16xx and
> reference them from the software nodes in the nokia board file.

...

>  #define ADS7846_PENDOWN_GPIO	15


This is the only definition for a GPIO pin and its purpose obvious from the
GPIO con_id below. So, while at it, perhaps get rid of it as well?..

> -	PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node,
> +	PROPERTY_ENTRY_GPIO("pendown-gpios", &omap16xx_gpio1_swnode,
>  			    ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_LOW),

...will become

	PROPERTY_ENTRY_GPIO("pendown-gpios", &omap16xx_gpio1_swnode, 15, GPIO_ACTIVE_LOW),

(or wrapped version).

-- 
With Best Regards,
Andy Shevchenko




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-04-27 14:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 10:46 [PATCH v6 0/3] ARM: omap1: use real firmware node lookup for GPIOs on Nokia 770 Bartosz Golaszewski
2026-04-27 10:46 ` [PATCH v6 1/3] ARM: omap1: drop unused variable from omap16xx_gpio_init() Bartosz Golaszewski
2026-04-27 10:52   ` Arnd Bergmann
2026-04-27 10:46 ` [PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx Bartosz Golaszewski
2026-04-27 10:50   ` Arnd Bergmann
2026-04-27 14:43   ` Andy Shevchenko
2026-04-27 14:47     ` Andy Shevchenko
2026-04-27 14:48     ` Bartosz Golaszewski
2026-04-27 10:46 ` [PATCH v6 3/3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Bartosz Golaszewski
2026-04-27 14:52   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox