public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] gpio: timberdale: remove platform data header
@ 2026-03-16  9:30 Bartosz Golaszewski
  2026-03-16  9:30 ` [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell Bartosz Golaszewski
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Bartosz Golaszewski @ 2026-03-16  9:30 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Andy Shevchenko, Bartosz Golaszewski
  Cc: linux-kernel, linux-gpio, Bartosz Golaszewski

There are several GPIO driver header scattered directly under
include/linux/. I'd like to either remove them or move then under
include/linux/gpio/. In case of gpio-timberdale, the platform data
struct can be replaced with generic device properties. This series does
that. It can go either though the MFD tree or GPIO with an Ack from Lee.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v2:
- Change the property names to make them consistent with existing ones
  used by intel
- Link to v1: https://patch.msgid.link/20260313-gpio-timberdale-swnode-v1-0-4df2e9b1dab5@oss.qualcomm.com

---
Bartosz Golaszewski (3):
      mfd: timberdale: set up a software node for the GPIO cell
      gpio: timberdale: use device properties
      gpio: timberdale: remove platform data header

 drivers/gpio/gpio-timberdale.c | 26 +++++++++++++-------------
 drivers/mfd/timberdale.c       | 29 ++++++++++++++---------------
 include/linux/timb_gpio.h      | 25 -------------------------
 3 files changed, 27 insertions(+), 53 deletions(-)
---
base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
change-id: 20260313-gpio-timberdale-swnode-03b1a0945359

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


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

* [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell
  2026-03-16  9:30 [PATCH v2 0/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
@ 2026-03-16  9:30 ` Bartosz Golaszewski
  2026-03-26 10:52   ` Lee Jones
  2026-03-16  9:30 ` [PATCH v2 2/3] gpio: timberdale: use device properties Bartosz Golaszewski
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Bartosz Golaszewski @ 2026-03-16  9:30 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Andy Shevchenko, Bartosz Golaszewski
  Cc: linux-kernel, linux-gpio, Bartosz Golaszewski

Create a software node with device properties for the GPIO cell and
attach it to all the GPIO cells.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/mfd/timberdale.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index a4d9c070d481a182890a58e4b8c850c4c29f7f17..8d7dfeaa76258d02e50528e39c4f7125d9201388 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -181,6 +181,18 @@ static struct timbgpio_platform_data
 	.irq_base = 200,
 };
 
+static const struct property_entry timberdale_gpio_properties[] = {
+	PROPERTY_ENTRY_U32("ngpios", GPIO_NR_PINS),
+	PROPERTY_ENTRY_U32("gpio-base", 0),
+	PROPERTY_ENTRY_U32("irq-base", 200),
+	{ }
+};
+
+static const struct software_node timberdale_gpio_swnode = {
+	.name = "timb-gpio",
+	.properties = timberdale_gpio_properties,
+};
+
 static const struct resource timberdale_gpio_resources[] = {
 	{
 		.start	= GPIOOFFSET,
@@ -392,6 +404,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.resources = timberdale_gpio_resources,
 		.platform_data = &timberdale_gpio_platform_data,
 		.pdata_size = sizeof(timberdale_gpio_platform_data),
+		.swnode = &timberdale_gpio_swnode,
 	},
 	{
 		.name = "timb-video",
@@ -454,6 +467,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.resources = timberdale_gpio_resources,
 		.platform_data = &timberdale_gpio_platform_data,
 		.pdata_size = sizeof(timberdale_gpio_platform_data),
+		.swnode = &timberdale_gpio_swnode,
 	},
 	{
 		.name = "timb-mlogicore",
@@ -516,6 +530,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.resources = timberdale_gpio_resources,
 		.platform_data = &timberdale_gpio_platform_data,
 		.pdata_size = sizeof(timberdale_gpio_platform_data),
+		.swnode = &timberdale_gpio_swnode,
 	},
 	{
 		.name = "timb-video",
@@ -566,6 +581,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.resources = timberdale_gpio_resources,
 		.platform_data = &timberdale_gpio_platform_data,
 		.pdata_size = sizeof(timberdale_gpio_platform_data),
+		.swnode = &timberdale_gpio_swnode,
 	},
 	{
 		.name = "timb-video",

-- 
2.47.3


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

* [PATCH v2 2/3] gpio: timberdale: use device properties
  2026-03-16  9:30 [PATCH v2 0/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
  2026-03-16  9:30 ` [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell Bartosz Golaszewski
@ 2026-03-16  9:30 ` Bartosz Golaszewski
  2026-03-16 15:09   ` Andy Shevchenko
  2026-03-16  9:30 ` [PATCH v2 3/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Bartosz Golaszewski @ 2026-03-16  9:30 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Andy Shevchenko, Bartosz Golaszewski
  Cc: linux-kernel, linux-gpio, Bartosz Golaszewski

The top-level MFD driver now passes the device properties to the GPIO
cell via the software node. Use generic device property accessors and
stop using platform data. We can ignore the "ngpios" property here now
as it will be retrieved internally by GPIO core.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/gpio/gpio-timberdale.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index f488939dd00a8a7f332d3af27962a38a3b7e6ecf..78fe133f5d32350567c28a1cc982d7bb3183ff2b 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -14,7 +14,6 @@
 #include <linux/platform_device.h>
 #include <linux/irq.h>
 #include <linux/io.h>
-#include <linux/timb_gpio.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 
@@ -225,19 +224,21 @@ static int timbgpio_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct gpio_chip *gc;
 	struct timbgpio *tgpio;
-	struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	int irq = platform_get_irq(pdev, 0);
 
-	if (!pdata || pdata->nr_pins > 32) {
-		dev_err(dev, "Invalid platform data\n");
-		return -EINVAL;
-	}
-
 	tgpio = devm_kzalloc(dev, sizeof(*tgpio), GFP_KERNEL);
 	if (!tgpio)
 		return -EINVAL;
 
-	tgpio->irq_base = pdata->irq_base;
+	gc = &tgpio->gpio;
+
+	err = device_property_read_u32(dev, "irq-base", &tgpio->irq_base);
+	if (err)
+		return err;
+
+	err = device_property_read_u32(dev, "gpio-base", &gc->base);
+	if (err)
+		return err;
 
 	spin_lock_init(&tgpio->lock);
 
@@ -245,8 +246,6 @@ static int timbgpio_probe(struct platform_device *pdev)
 	if (IS_ERR(tgpio->membase))
 		return PTR_ERR(tgpio->membase);
 
-	gc = &tgpio->gpio;
-
 	gc->label = dev_name(&pdev->dev);
 	gc->owner = THIS_MODULE;
 	gc->parent = &pdev->dev;
@@ -256,21 +255,22 @@ static int timbgpio_probe(struct platform_device *pdev)
 	gc->set = timbgpio_gpio_set;
 	gc->to_irq = (irq >= 0 && tgpio->irq_base > 0) ? timbgpio_to_irq : NULL;
 	gc->dbg_show = NULL;
-	gc->base = pdata->gpio_base;
-	gc->ngpio = pdata->nr_pins;
 	gc->can_sleep = false;
 
 	err = devm_gpiochip_add_data(&pdev->dev, gc, tgpio);
 	if (err)
 		return err;
 
+	if (gc->ngpio > 32)
+		return dev_err_probe(dev, -EINVAL, "Invalid number of pins\n");
+
 	/* make sure to disable interrupts */
 	iowrite32(0x0, tgpio->membase + TGPIO_IER);
 
 	if (irq < 0 || tgpio->irq_base <= 0)
 		return 0;
 
-	for (i = 0; i < pdata->nr_pins; i++) {
+	for (i = 0; i < gc->ngpio; i++) {
 		irq_set_chip_and_handler(tgpio->irq_base + i,
 			&timbgpio_irqchip, handle_simple_irq);
 		irq_set_chip_data(tgpio->irq_base + i, tgpio);

-- 
2.47.3


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

* [PATCH v2 3/3] gpio: timberdale: remove platform data header
  2026-03-16  9:30 [PATCH v2 0/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
  2026-03-16  9:30 ` [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell Bartosz Golaszewski
  2026-03-16  9:30 ` [PATCH v2 2/3] gpio: timberdale: use device properties Bartosz Golaszewski
@ 2026-03-16  9:30 ` Bartosz Golaszewski
  2026-03-16 15:10 ` [PATCH v2 0/3] " Andy Shevchenko
  2026-03-19 13:39 ` Linus Walleij
  4 siblings, 0 replies; 9+ messages in thread
From: Bartosz Golaszewski @ 2026-03-16  9:30 UTC (permalink / raw)
  To: Lee Jones, Linus Walleij, Andy Shevchenko, Bartosz Golaszewski
  Cc: linux-kernel, linux-gpio, Bartosz Golaszewski

With no more users, we can remove timb_gpio.h.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/mfd/timberdale.c  | 17 -----------------
 include/linux/timb_gpio.h | 25 -------------------------
 2 files changed, 42 deletions(-)

diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 8d7dfeaa76258d02e50528e39c4f7125d9201388..77d00d19b07050997b1d1c6e96eec0896a5a6867 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -15,8 +15,6 @@
 #include <linux/property.h>
 #include <linux/slab.h>
 
-#include <linux/timb_gpio.h>
-
 #include <linux/i2c.h>
 #include <linux/platform_data/i2c-ocores.h>
 #include <linux/platform_data/i2c-xiic.h>
@@ -174,13 +172,6 @@ static const struct resource timberdale_eth_resources[] = {
 	},
 };
 
-static struct timbgpio_platform_data
-	timberdale_gpio_platform_data = {
-	.gpio_base = 0,
-	.nr_pins = GPIO_NR_PINS,
-	.irq_base = 200,
-};
-
 static const struct property_entry timberdale_gpio_properties[] = {
 	PROPERTY_ENTRY_U32("ngpios", GPIO_NR_PINS),
 	PROPERTY_ENTRY_U32("gpio-base", 0),
@@ -402,8 +393,6 @@ static const struct mfd_cell timberdale_cells_bar0_cfg0[] = {
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
-		.pdata_size = sizeof(timberdale_gpio_platform_data),
 		.swnode = &timberdale_gpio_swnode,
 	},
 	{
@@ -465,8 +454,6 @@ static const struct mfd_cell timberdale_cells_bar0_cfg1[] = {
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
-		.pdata_size = sizeof(timberdale_gpio_platform_data),
 		.swnode = &timberdale_gpio_swnode,
 	},
 	{
@@ -528,8 +515,6 @@ static const struct mfd_cell timberdale_cells_bar0_cfg2[] = {
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
-		.pdata_size = sizeof(timberdale_gpio_platform_data),
 		.swnode = &timberdale_gpio_swnode,
 	},
 	{
@@ -579,8 +564,6 @@ static const struct mfd_cell timberdale_cells_bar0_cfg3[] = {
 		.name = "timb-gpio",
 		.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
 		.resources = timberdale_gpio_resources,
-		.platform_data = &timberdale_gpio_platform_data,
-		.pdata_size = sizeof(timberdale_gpio_platform_data),
 		.swnode = &timberdale_gpio_swnode,
 	},
 	{
diff --git a/include/linux/timb_gpio.h b/include/linux/timb_gpio.h
deleted file mode 100644
index 74f5e73bf6db67170817352415ca58b415870886..0000000000000000000000000000000000000000
--- a/include/linux/timb_gpio.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * timb_gpio.h timberdale FPGA GPIO driver, platform data definition
- * Copyright (c) 2009 Intel Corporation
- */
-
-#ifndef _LINUX_TIMB_GPIO_H
-#define _LINUX_TIMB_GPIO_H
-
-/**
- * struct timbgpio_platform_data - Platform data of the Timberdale GPIO driver
- * @gpio_base:		The number of the first GPIO pin, set to -1 for
- *			dynamic number allocation.
- * @nr_pins:		Number of pins that is supported by the hardware (1-32)
- * @irq_base:		If IRQ is supported by the hardware, this is the base
- *			number of IRQ:s. One IRQ per pin will be used. Set to
- *			-1 if IRQ:s is not supported.
- */
-struct timbgpio_platform_data {
-	int gpio_base;
-	int nr_pins;
-	int irq_base;
-};
-
-#endif

-- 
2.47.3


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

* Re: [PATCH v2 2/3] gpio: timberdale: use device properties
  2026-03-16  9:30 ` [PATCH v2 2/3] gpio: timberdale: use device properties Bartosz Golaszewski
@ 2026-03-16 15:09   ` Andy Shevchenko
  0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2026-03-16 15:09 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Lee Jones, Linus Walleij, Bartosz Golaszewski, linux-kernel,
	linux-gpio

On Mon, Mar 16, 2026 at 10:30:49AM +0100, Bartosz Golaszewski wrote:
> The top-level MFD driver now passes the device properties to the GPIO
> cell via the software node. Use generic device property accessors and
> stop using platform data. We can ignore the "ngpios" property here now
> as it will be retrieved internally by GPIO core.

...

>  	int irq = platform_get_irq(pdev, 0);


>  	gc->to_irq = (irq >= 0 && tgpio->irq_base > 0) ? timbgpio_to_irq : NULL;

>  	if (irq < 0 || tgpio->irq_base <= 0)
>  		return 0;

I believe we also want to have a fix of the above (it will print a message when
it's fine to continue and checks for irq > 0 twice).

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v2 0/3] gpio: timberdale: remove platform data header
  2026-03-16  9:30 [PATCH v2 0/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2026-03-16  9:30 ` [PATCH v2 3/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
@ 2026-03-16 15:10 ` Andy Shevchenko
  2026-03-19 13:39 ` Linus Walleij
  4 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2026-03-16 15:10 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Lee Jones, Linus Walleij, Bartosz Golaszewski, linux-kernel,
	linux-gpio

On Mon, Mar 16, 2026 at 10:30:47AM +0100, Bartosz Golaszewski wrote:
> There are several GPIO driver header scattered directly under
> include/linux/. I'd like to either remove them or move then under
> include/linux/gpio/. In case of gpio-timberdale, the platform data
> struct can be replaced with generic device properties. This series does
> that. It can go either though the MFD tree or GPIO with an Ack from Lee.

I understand that fixes for the 'irq' handling mess is not your patch scope,
but still consider it, please.

Anyways, this series is good on its own,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v2 0/3] gpio: timberdale: remove platform data header
  2026-03-16  9:30 [PATCH v2 0/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
                   ` (3 preceding siblings ...)
  2026-03-16 15:10 ` [PATCH v2 0/3] " Andy Shevchenko
@ 2026-03-19 13:39 ` Linus Walleij
  4 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2026-03-19 13:39 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Lee Jones, Andy Shevchenko, Bartosz Golaszewski, linux-kernel,
	linux-gpio

On Mon, Mar 16, 2026 at 10:31 AM Bartosz Golaszewski
<bartosz.golaszewski@oss.qualcomm.com> wrote:

> There are several GPIO driver header scattered directly under
> include/linux/. I'd like to either remove them or move then under
> include/linux/gpio/. In case of gpio-timberdale, the platform data
> struct can be replaced with generic device properties. This series does
> that. It can go either though the MFD tree or GPIO with an Ack from Lee.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

The series:

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

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

* Re: [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell
  2026-03-16  9:30 ` [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell Bartosz Golaszewski
@ 2026-03-26 10:52   ` Lee Jones
  2026-03-26 13:41     ` Bartosz Golaszewski
  0 siblings, 1 reply; 9+ messages in thread
From: Lee Jones @ 2026-03-26 10:52 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Andy Shevchenko, Bartosz Golaszewski, linux-kernel,
	linux-gpio

On Mon, 16 Mar 2026, Bartosz Golaszewski wrote:

> Create a software node with device properties for the GPIO cell and
> attach it to all the GPIO cells.

Could you elaborate a little on the motivation for this change, please?
I assume this is the first step in a larger plan to convert the GPIO
child driver to use device properties and remove the legacy 'platform_data'.
If so, it would be good to state that in the commit message or a cover
letter for the series.

> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/mfd/timberdale.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
> index a4d9c070d481a182890a58e4b8c850c4c29f7f17..8d7dfeaa76258d02e50528e39c4f7125d9201388 100644
> --- a/drivers/mfd/timberdale.c
> +++ b/drivers/mfd/timberdale.c
> @@ -181,6 +181,18 @@ static struct timbgpio_platform_data
>  	.irq_base = 200,
>  };
>  
> +static const struct property_entry timberdale_gpio_properties[] = {
> +	PROPERTY_ENTRY_U32("ngpios", GPIO_NR_PINS),
> +	PROPERTY_ENTRY_U32("gpio-base", 0),

This appears to introduce a functional change. The existing 'platform_data'
sets 'gpio_base' to -1, which results in dynamic allocation. Hard-coding
a base of 0 here is very likely to cause conflicts.

Should this property be removed to retain the dynamic allocation behaviour?

> +	PROPERTY_ENTRY_U32("irq-base", 200),

This magic number should be defined.

> +	{ }
> +};
> +
> +static const struct software_node timberdale_gpio_swnode = {
> +	.name = "timb-gpio",
> +	.properties = timberdale_gpio_properties,
> +};
> +
>  static const struct resource timberdale_gpio_resources[] = {
>  	{
>  		.start	= GPIOOFFSET,
> @@ -392,6 +404,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg0[] = {
>  		.resources = timberdale_gpio_resources,
>  		.platform_data = &timberdale_gpio_platform_data,
>  		.pdata_size = sizeof(timberdale_gpio_platform_data),
> +		.swnode = &timberdale_gpio_swnode,
>  	},
>  	{
>  		.name = "timb-video",
> @@ -454,6 +467,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg1[] = {
>  		.resources = timberdale_gpio_resources,
>  		.platform_data = &timberdale_gpio_platform_data,
>  		.pdata_size = sizeof(timberdale_gpio_platform_data),
> +		.swnode = &timberdale_gpio_swnode,
>  	},
>  	{
>  		.name = "timb-mlogicore",
> @@ -516,6 +530,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg2[] = {
>  		.resources = timberdale_gpio_resources,
>  		.platform_data = &timberdale_gpio_platform_data,
>  		.pdata_size = sizeof(timberdale_gpio_platform_data),
> +		.swnode = &timberdale_gpio_swnode,
>  	},
>  	{
>  		.name = "timb-video",
> @@ -566,6 +581,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg3[] = {
>  		.resources = timberdale_gpio_resources,
>  		.platform_data = &timberdale_gpio_platform_data,
>  		.pdata_size = sizeof(timberdale_gpio_platform_data),
> +		.swnode = &timberdale_gpio_swnode,
>  	},
>  	{
>  		.name = "timb-video",
> 
> -- 
> 2.47.3
> 

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell
  2026-03-26 10:52   ` Lee Jones
@ 2026-03-26 13:41     ` Bartosz Golaszewski
  0 siblings, 0 replies; 9+ messages in thread
From: Bartosz Golaszewski @ 2026-03-26 13:41 UTC (permalink / raw)
  To: Lee Jones
  Cc: Bartosz Golaszewski, Linus Walleij, Andy Shevchenko, linux-kernel,
	linux-gpio

On Thu, Mar 26, 2026 at 11:52 AM Lee Jones <lee@kernel.org> wrote:
>
> On Mon, 16 Mar 2026, Bartosz Golaszewski wrote:
>
> > Create a software node with device properties for the GPIO cell and
> > attach it to all the GPIO cells.
>
> Could you elaborate a little on the motivation for this change, please?
> I assume this is the first step in a larger plan to convert the GPIO
> child driver to use device properties and remove the legacy 'platform_data'.
> If so, it would be good to state that in the commit message or a cover
> letter for the series.
>

Sure, I'll remember next time. It's not really a larger plan, I'm just
trying to clean up various GPIO-related headers specific to individual
drivers. Most platform data structures can easily be converted to
device properties.

> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> > ---
> >  drivers/mfd/timberdale.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
> > index a4d9c070d481a182890a58e4b8c850c4c29f7f17..8d7dfeaa76258d02e50528e39c4f7125d9201388 100644
> > --- a/drivers/mfd/timberdale.c
> > +++ b/drivers/mfd/timberdale.c
> > @@ -181,6 +181,18 @@ static struct timbgpio_platform_data
> >       .irq_base = 200,
> >  };
> >
> > +static const struct property_entry timberdale_gpio_properties[] = {
> > +     PROPERTY_ENTRY_U32("ngpios", GPIO_NR_PINS),
> > +     PROPERTY_ENTRY_U32("gpio-base", 0),
>
> This appears to introduce a functional change. The existing 'platform_data'
> sets 'gpio_base' to -1, which results in dynamic allocation. Hard-coding
> a base of 0 here is very likely to cause conflicts.
>

Please look at the definition of struct timbgpio_platform_data patch
3/3 removes. It also sets base to 0 so I'm actually avoiding a
functional change here.


> Should this property be removed to retain the dynamic allocation behaviour?
>
> > +     PROPERTY_ENTRY_U32("irq-base", 200),
>
> This magic number should be defined.
>

It was not defined in platform data either but sure, I can fix it in v2.

Bart

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

end of thread, other threads:[~2026-03-26 13:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16  9:30 [PATCH v2 0/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
2026-03-16  9:30 ` [PATCH v2 1/3] mfd: timberdale: set up a software node for the GPIO cell Bartosz Golaszewski
2026-03-26 10:52   ` Lee Jones
2026-03-26 13:41     ` Bartosz Golaszewski
2026-03-16  9:30 ` [PATCH v2 2/3] gpio: timberdale: use device properties Bartosz Golaszewski
2026-03-16 15:09   ` Andy Shevchenko
2026-03-16  9:30 ` [PATCH v2 3/3] gpio: timberdale: remove platform data header Bartosz Golaszewski
2026-03-16 15:10 ` [PATCH v2 0/3] " Andy Shevchenko
2026-03-19 13:39 ` Linus Walleij

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