mfd: lpc_ich: Expose the GPIO controller cell's software node

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.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260218-meraki-swnodes-v2-1-92c521da241c@oss.qualcomm.com
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Bartosz Golaszewski 2026-02-18 11:48:01 +01:00 committed by Lee Jones
parent 239cd6a417
commit 0735e3007c
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -37,4 +37,6 @@ struct lpc_ich_info {
u8 use_gpio;
};
extern const struct software_node lpc_ich_gpio_swnode;
#endif