[PATCH v2 1/2] mfd: lpc_ich: expose the GPIO controller cell's software node

Bartosz Golaszewski posted 2 patches 1 month, 1 week ago
[PATCH v2 1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
Posted by Bartosz Golaszewski 1 month, 1 week ago
One of the users of this driver - meraki-mx100 - abuses the software
node API by setting up a dummy software node without any logical link to
this GPIO controller and uses the fact that the GPIO core matches the
controller's label against the swnode's name to make the lookup work.

We want to remove this behavior from GPIOLIB in favor of actual matching
of firmware nodes but that would break this user. To facilitate that:
create a software node for the GPIO controller cell and expose its
address in the provided MFD header.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/mfd/lpc_ich.c       | 7 +++++++
 include/linux/mfd/lpc_ich.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 4b7d0cb9340f1ac51bf3845427ba1dee8cad5667..5a3d79f339dd23994aee615c2dd6ef637e3c14a4 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -45,6 +45,7 @@
 #include <linux/acpi.h>
 #include <linux/pci.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/lpc_ich.h>
 #include <linux/platform_data/itco_wdt.h>
@@ -125,11 +126,17 @@ static struct mfd_cell lpc_ich_wdt_cell = {
 	.ignore_resource_conflicts = true,
 };
 
+const struct software_node lpc_ich_gpio_swnode = {
+	.name = "gpio_ich",
+};
+EXPORT_SYMBOL_NS(lpc_ich_gpio_swnode, "LPC_ICH");
+
 static struct mfd_cell lpc_ich_gpio_cell = {
 	.name = "gpio_ich",
 	.num_resources = ARRAY_SIZE(gpio_ich_res),
 	.resources = gpio_ich_res,
 	.ignore_resource_conflicts = true,
+	.swnode = &lpc_ich_gpio_swnode,
 };
 
 #define INTEL_GPIO_RESOURCE_SIZE	0x1000
diff --git a/include/linux/mfd/lpc_ich.h b/include/linux/mfd/lpc_ich.h
index 1fbda1f8967db41ba3bacd331e5d18dfa8ebca3c..1819aa743c5c9aa1ac51710bbdbbefab50670ebe 100644
--- a/include/linux/mfd/lpc_ich.h
+++ b/include/linux/mfd/lpc_ich.h
@@ -37,4 +37,6 @@ struct lpc_ich_info {
 	u8 use_gpio;
 };
 
+extern const struct software_node lpc_ich_gpio_swnode;
+
 #endif

-- 
2.47.3
Re: (subset) [PATCH v2 1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
Posted by Lee Jones 3 weeks, 6 days ago
On Wed, 18 Feb 2026 11:48:01 +0100, Bartosz Golaszewski wrote:
> One of the users of this driver - meraki-mx100 - abuses the software
> node API by setting up a dummy software node without any logical link to
> this GPIO controller and uses the fact that the GPIO core matches the
> controller's label against the swnode's name to make the lookup work.
> 
> We want to remove this behavior from GPIOLIB in favor of actual matching
> of firmware nodes but that would break this user. To facilitate that:
> create a software node for the GPIO controller cell and expose its
> address in the provided MFD header.
> 
> [...]

Applied, thanks!

[1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
      commit: a64ee7d8ddd6e04d82c06238a238b7877cbc35fc

--
Lee Jones [李琼斯]

Re: (subset) [PATCH v2 1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
Posted by Bartosz Golaszewski 3 weeks, 6 days ago
On Fri, Mar 6, 2026 at 1:53 PM Lee Jones <lee@kernel.org> wrote:
>
> On Wed, 18 Feb 2026 11:48:01 +0100, Bartosz Golaszewski wrote:
> > One of the users of this driver - meraki-mx100 - abuses the software
> > node API by setting up a dummy software node without any logical link to
> > this GPIO controller and uses the fact that the GPIO core matches the
> > controller's label against the swnode's name to make the lookup work.
> >
> > We want to remove this behavior from GPIOLIB in favor of actual matching
> > of firmware nodes but that would break this user. To facilitate that:
> > create a software node for the GPIO controller cell and expose its
> > address in the provided MFD header.
> >
> > [...]
>
> Applied, thanks!
>
> [1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
>       commit: a64ee7d8ddd6e04d82c06238a238b7877cbc35fc
>
> --
> Lee Jones [李琼斯]
>

Hi Lee!

Can you pick up patch 2/2 as well as per Ilpo's response and Ack?

Bart
Re: (subset) [PATCH v2 1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
Posted by Lee Jones 3 weeks, 3 days ago
On Fri, 06 Mar 2026, Bartosz Golaszewski wrote:

> On Fri, Mar 6, 2026 at 1:53 PM Lee Jones <lee@kernel.org> wrote:
> >
> > On Wed, 18 Feb 2026 11:48:01 +0100, Bartosz Golaszewski wrote:
> > > One of the users of this driver - meraki-mx100 - abuses the software
> > > node API by setting up a dummy software node without any logical link to
> > > this GPIO controller and uses the fact that the GPIO core matches the
> > > controller's label against the swnode's name to make the lookup work.
> > >
> > > We want to remove this behavior from GPIOLIB in favor of actual matching
> > > of firmware nodes but that would break this user. To facilitate that:
> > > create a software node for the GPIO controller cell and expose its
> > > address in the provided MFD header.
> > >
> > > [...]
> >
> > Applied, thanks!
> >
> > [1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
> >       commit: a64ee7d8ddd6e04d82c06238a238b7877cbc35fc
> >
> > --
> > Lee Jones [李琼斯]
> >
> 
> Hi Lee!
> 
> Can you pick up patch 2/2 as well as per Ilpo's response and Ack?

Are there dependencies between the two patches?

-- 
Lee Jones [李琼斯]
Re: (subset) [PATCH v2 1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
Posted by Bartosz Golaszewski 3 weeks, 3 days ago
On Mon, Mar 9, 2026 at 10:55 AM Lee Jones <lee@kernel.org> wrote:
>
> On Fri, 06 Mar 2026, Bartosz Golaszewski wrote:
>
> > On Fri, Mar 6, 2026 at 1:53 PM Lee Jones <lee@kernel.org> wrote:
> > >
> > > On Wed, 18 Feb 2026 11:48:01 +0100, Bartosz Golaszewski wrote:
> > > > One of the users of this driver - meraki-mx100 - abuses the software
> > > > node API by setting up a dummy software node without any logical link to
> > > > this GPIO controller and uses the fact that the GPIO core matches the
> > > > controller's label against the swnode's name to make the lookup work.
> > > >
> > > > We want to remove this behavior from GPIOLIB in favor of actual matching
> > > > of firmware nodes but that would break this user. To facilitate that:
> > > > create a software node for the GPIO controller cell and expose its
> > > > address in the provided MFD header.
> > > >
> > > > [...]
> > >
> > > Applied, thanks!
> > >
> > > [1/2] mfd: lpc_ich: expose the GPIO controller cell's software node
> > >       commit: a64ee7d8ddd6e04d82c06238a238b7877cbc35fc
> > >
> > > --
> > > Lee Jones [李琼斯]
> > >
> >
> > Hi Lee!
> >
> > Can you pick up patch 2/2 as well as per Ilpo's response and Ack?
>
> Are there dependencies between the two patches?
>

Yes, patch 2 needs to see the symbol exported in patch 1.

Bartosz