* [PATCH 1/2] mfd: cs5535: add, assign and expose the software node for the GPIO cell
2026-04-29 12:23 [PATCH 0/2] x86/platform/geode: enable real fwnode GPIO lookup Bartosz Golaszewski
@ 2026-04-29 12:23 ` Bartosz Golaszewski
2026-04-29 12:23 ` [PATCH 2/2] x86/platform/geode: reference the real node of the cs5535 GPIO controller Bartosz Golaszewski
1 sibling, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-04-29 12:23 UTC (permalink / raw)
To: Lee Jones, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, Dmitry Torokhov
Cc: brgl, linux-kernel, Bartosz Golaszewski
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 <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/mfd/cs5535-mfd.c | 9 +++++++++
include/linux/mfd/cs5535.h | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c
index d0fb2e52ee76a82ab18f668f41b10ac3f4e01ed3..f3becbef19f5dac1905660df1ac6cbc4f7f4d867 100644
--- a/drivers/mfd/cs5535-mfd.c
+++ b/drivers/mfd/cs5535-mfd.c
@@ -12,8 +12,11 @@
#include <linux/kernel.h>
#include <linux/mfd/core.h>
+#include <linux/mfd/cs5535.h>
#include <linux/module.h>
#include <linux/pci.h>
+#include <linux/property.h>
+
#include <asm/olpc.h>
#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 0000000000000000000000000000000000000000..2e4ebf5d06af7453c417b3b5dda14572fb5e1ab2
--- /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__ */
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] x86/platform/geode: reference the real node of the cs5535 GPIO controller
2026-04-29 12:23 [PATCH 0/2] x86/platform/geode: enable real fwnode GPIO lookup Bartosz Golaszewski
2026-04-29 12:23 ` [PATCH 1/2] mfd: cs5535: add, assign and expose the software node for the GPIO cell Bartosz Golaszewski
@ 2026-04-29 12:23 ` Bartosz Golaszewski
2026-04-29 19:06 ` Dmitry Torokhov
1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-04-29 12:23 UTC (permalink / raw)
To: Lee Jones, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, Dmitry Torokhov
Cc: brgl, linux-kernel, Bartosz Golaszewski
We now can access the address of the software node associated with the
GPIO controller cell of the cs5535 MFD device. Make it the target of the
GPIO software node references in geode-common.c. Make sure the cs5535
driver is built-in for all boards selecting GEODE_COMMON.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/x86/Kconfig | 10 +++++-----
arch/x86/platform/geode/geode-common.c | 12 +++++-------
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f3f7cb01d69d022538d283f6c7049ba8bd4c3792..1b3cb3d92bdeb0e02f249e1b4801f06fb5fd8648 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -3072,7 +3072,7 @@ config GEODE_COMMON
config ALIX
bool "PCEngines ALIX System Support (LED setup)"
- select GPIOLIB
+ depends on GPIO_CS5535=y
select GEODE_COMMON
help
This option enables system support for the PCEngines ALIX.
@@ -3080,21 +3080,21 @@ config ALIX
ALIX2/3/6 boards. However, other system specific setup should
get added here.
- Note: You must still enable the drivers for GPIO and LED support
- (GPIO_CS5535 & LEDS_GPIO) to actually use the LEDs
+ Note: You must still enable the drivers for LED support (LEDS_GPIO)
+ to actually use the LEDs
Note: You have to set alix.force=1 for boards with Award BIOS.
config NET5501
bool "Soekris Engineering net5501 System Support (LEDS, GPIO, etc)"
- select GPIOLIB
+ depends on GPIO_CS5535=y
select GEODE_COMMON
help
This option enables system support for the Soekris Engineering net5501.
config GEOS
bool "Traverse Technologies GEOS System Support (LEDS, GPIO, etc)"
- select GPIOLIB
+ depends on GPIO_CS5535=y
select GEODE_COMMON
depends on DMI
help
diff --git a/arch/x86/platform/geode/geode-common.c b/arch/x86/platform/geode/geode-common.c
index 1843ae385e2dc038fde6fb02f6de0b818e22d8dd..679b4b07b790db3ce1c06bd6639bba7516ca3f71 100644
--- a/arch/x86/platform/geode/geode-common.c
+++ b/arch/x86/platform/geode/geode-common.c
@@ -9,15 +9,12 @@
#include <linux/gpio/property.h>
#include <linux/input.h>
#include <linux/leds.h>
+#include <linux/mfd/cs5535.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include "geode-common.h"
-static const struct software_node geode_gpiochip_node = {
- .name = "cs5535-gpio",
-};
-
static const struct property_entry geode_gpio_keys_props[] = {
PROPERTY_ENTRY_U32("poll-interval", 20),
{ }
@@ -44,7 +41,6 @@ static const struct software_node geode_restart_key_node = {
};
static const struct software_node *geode_gpio_keys_swnodes[] __initconst = {
- &geode_gpiochip_node,
&geode_gpio_keys_node,
&geode_restart_key_node,
NULL
@@ -66,7 +62,7 @@ int __init geode_create_restart_key(unsigned int pin)
struct platform_device *pd;
int err;
- geode_restart_gpio_ref = SOFTWARE_NODE_REFERENCE(&geode_gpiochip_node,
+ geode_restart_gpio_ref = SOFTWARE_NODE_REFERENCE(&cs5535_gpio_swnode,
pin, GPIO_ACTIVE_LOW);
err = software_node_register_node_group(geode_gpio_keys_swnodes);
@@ -143,7 +139,7 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds,
goto err_free_names;
}
- gpio_refs[i] = SOFTWARE_NODE_REFERENCE(&geode_gpiochip_node,
+ gpio_refs[i] = SOFTWARE_NODE_REFERENCE(&cs5535_gpio_swnode,
leds[i].pin,
GPIO_ACTIVE_LOW);
props[i * 3 + 0] =
@@ -188,3 +184,5 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds,
kfree(swnodes);
return err;
}
+
+MODULE_IMPORT_NS("CS5535");
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread