From 4b51f0da731adb1d3468518dc2deb5dae83978b7 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 29 Apr 2026 14:23:30 +0200 Subject: [PATCH] mfd: cs5535: Add, assign and expose the software node for the GPIO cell There are board files in-tree that want to request GPIOs from this chip. They currently rely on the GPIO core's mechanism of matching software nodes' labels against GPIO controller names. We want to remove this behavior from the kernel and to this end, we need to associate the referenced GPIO controller with its target software node. Create a dedicated GPIO software node for cs5535, assign it to the GPIO cell and expose its address in a new header. We only expose a single software node instance but that's alright: all existing hardware only contains a single cs5535 companion and the geode board file for which we expose this is legacy anyway. Signed-off-by: Bartosz Golaszewski Link: https://patch.msgid.link/20260429-cs5535-swnode-v1-1-2bc5e17ddcf9@oss.qualcomm.com Signed-off-by: Lee Jones --- drivers/mfd/cs5535-mfd.c | 9 +++++++++ include/linux/mfd/cs5535.h | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 include/linux/mfd/cs5535.h diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c index d0fb2e52ee76..f3becbef19f5 100644 --- a/drivers/mfd/cs5535-mfd.c +++ b/drivers/mfd/cs5535-mfd.c @@ -12,8 +12,11 @@ #include #include +#include #include #include +#include + #include #define DRV_NAME "cs5535-mfd" @@ -29,6 +32,11 @@ enum cs5535_mfd_bars { static struct resource cs5535_mfd_resources[NR_BARS]; +const struct software_node cs5535_gpio_swnode = { + .name = "cs5535-gpio", +}; +EXPORT_SYMBOL_NS(cs5535_gpio_swnode, "CS5535"); + static struct mfd_cell cs5535_mfd_cells[] = { { .name = "cs5535-smb", @@ -39,6 +47,7 @@ static struct mfd_cell cs5535_mfd_cells[] = { .name = "cs5535-gpio", .num_resources = 1, .resources = &cs5535_mfd_resources[GPIO_BAR], + .swnode = &cs5535_gpio_swnode, }, { .name = "cs5535-mfgpt", diff --git a/include/linux/mfd/cs5535.h b/include/linux/mfd/cs5535.h new file mode 100644 index 000000000000..2e4ebf5d06af --- /dev/null +++ b/include/linux/mfd/cs5535.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __MFD_CS5535_H__ +#define __MFD_CS5535_H__ + +extern const struct software_node cs5535_gpio_swnode; + +#endif /* __MFD_CS5535_H__ */