Skip to content

Commit 0735e30

Browse files
Bartosz Golaszewskilag-linaro
authored andcommitted
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>
1 parent 239cd6a commit 0735e30

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/mfd/lpc_ich.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <linux/acpi.h>
4646
#include <linux/pci.h>
4747
#include <linux/pinctrl/pinctrl.h>
48+
#include <linux/property.h>
4849
#include <linux/mfd/core.h>
4950
#include <linux/mfd/lpc_ich.h>
5051
#include <linux/platform_data/itco_wdt.h>
@@ -125,11 +126,17 @@ static struct mfd_cell lpc_ich_wdt_cell = {
125126
.ignore_resource_conflicts = true,
126127
};
127128

129+
const struct software_node lpc_ich_gpio_swnode = {
130+
.name = "gpio_ich",
131+
};
132+
EXPORT_SYMBOL_NS(lpc_ich_gpio_swnode, "LPC_ICH");
133+
128134
static struct mfd_cell lpc_ich_gpio_cell = {
129135
.name = "gpio_ich",
130136
.num_resources = ARRAY_SIZE(gpio_ich_res),
131137
.resources = gpio_ich_res,
132138
.ignore_resource_conflicts = true,
139+
.swnode = &lpc_ich_gpio_swnode,
133140
};
134141

135142
#define INTEL_GPIO_RESOURCE_SIZE 0x1000

include/linux/mfd/lpc_ich.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ struct lpc_ich_info {
3737
u8 use_gpio;
3838
};
3939

40+
extern const struct software_node lpc_ich_gpio_swnode;
41+
4042
#endif

0 commit comments

Comments
 (0)