Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Lee Jones <lee@kernel.org>, Linus Walleij <linusw@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: [PATCH v3 2/4] mfd: timberdale: set up a software node for the GPIO cell
Date: Fri, 27 Mar 2026 11:49:08 +0100	[thread overview]
Message-ID: <20260327-gpio-timberdale-swnode-v3-2-9a1bc1b2b124@oss.qualcomm.com> (raw)
In-Reply-To: <20260327-gpio-timberdale-swnode-v3-0-9a1bc1b2b124@oss.qualcomm.com>

Using generic device properties instead of custom platform data
structures is preferred due to the resulting unification of the way
properties are accessed in consumer drivers. There's no DT node for the
GPIO cell in this driver but we can create a software node with device
properties and attach it to all the GPIO cells.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/mfd/timberdale.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index d79419215cc292b705031a6432e877b94f9a1805..0ab3da3d6818e2108694dcf73f32184a167b701a 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -38,6 +38,8 @@
 #define DRIVER_NAME "timberdale"
 
 #define GPIO_NR_PINS	16
+#define GPIO_BASE	0
+#define IRQ_BASE	200
 
 struct timberdale_device {
 	resource_size_t		ctl_mapbase;
@@ -183,6 +185,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", GPIO_BASE),
+	PROPERTY_ENTRY_U32("irq-base", IRQ_BASE),
+	{ }
+};
+
+static const struct software_node timberdale_gpio_swnode = {
+	.name = "timb-gpio",
+	.properties = timberdale_gpio_properties,
+};
+
 static const struct resource timberdale_gpio_resources[] = {
 	{
 		.start	= GPIOOFFSET,
@@ -394,6 +408,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",
@@ -456,6 +471,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",
@@ -518,6 +534,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",
@@ -568,6 +585,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


  parent reply	other threads:[~2026-03-27 10:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27 10:49 [PATCH v3 0/4] gpio: timberdale: remove platform data header Bartosz Golaszewski
2026-03-27 10:49 ` [PATCH v3 1/4] mfd: timberdale: move GPIO_NR_PINS into the driver Bartosz Golaszewski
2026-03-27 11:02   ` Andy Shevchenko
2026-04-09 12:51   ` Lee Jones
2026-04-09 13:18   ` (subset) " Lee Jones
2026-04-09 13:20     ` Lee Jones
2026-04-09 13:21       ` Bartosz Golaszewski
2026-04-09 13:45         ` Lee Jones
2026-03-27 10:49 ` Bartosz Golaszewski [this message]
2026-04-30  9:48   ` (subset) [PATCH v3 2/4] mfd: timberdale: set up a software node for the GPIO cell Lee Jones
2026-04-30  9:53     ` Lee Jones
2026-03-27 10:49 ` [PATCH v3 3/4] gpio: timberdale: use device properties Bartosz Golaszewski
2026-03-27 10:49 ` [PATCH v3 4/4] gpio: timberdale: remove platform data header Bartosz Golaszewski
2026-04-09 13:21 ` [PATCH v3 0/4] " Lee Jones
2026-04-30  9:48 ` Lee Jones
2026-04-30  9:52   ` Lee Jones
2026-05-11  7:34     ` Bartosz Golaszewski
2026-05-13 13:39       ` Lee Jones
2026-05-13 13:44         ` Bartosz Golaszewski
2026-05-07 15:28 ` [GIT PULL] Immutable branch between MFD and GPIO due for the v7.2 merge window Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260327-gpio-timberdale-swnode-v3-2-9a1bc1b2b124@oss.qualcomm.com \
    --to=bartosz.golaszewski@oss.qualcomm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=lee@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).