[PATCH 3/4] pinctrl: intel: expose software nodes for cherryiew GPIO devices

From: Bartosz Golaszewski

Date: Thu Mar 19 2026 - 12:31:43 EST


Use the new automatic secondary fwnode API to ensure that when the
cherryview pinctrl device is added to the platform bus, the static
software node provided for drivers not able to use ACPI will get
automatically assigned as the secondary fwnode of the primary ACPI node.

Update the existing intel.h header with new symbols.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
drivers/pinctrl/intel/pinctrl-cherryview.c | 47 +++++++++++++++++++++++++++++-
include/linux/pinctrl/intel.h | 5 ++++
2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index a33eca5eafc44ee3337c4665967682404cb6ece0..45e52a796c8201c844127dbab497b4b3002930dc 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -21,6 +21,7 @@
#include <linux/types.h>

#include <linux/pinctrl/consumer.h>
+#include <linux/pinctrl/intel.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
@@ -1769,15 +1770,59 @@ static struct platform_driver chv_pinctrl_driver = {
},
};

+const struct software_node cherryview_gpio_node_00 = {
+ .name = "INT33FF:00",
+};
+EXPORT_SYMBOL_NS_GPL(cherryview_gpio_node_00, "PINCTRL_INTEL");
+
+const struct software_node cherryview_gpio_node_01 = {
+ .name = "INT33FF:01",
+};
+EXPORT_SYMBOL_NS_GPL(cherryview_gpio_node_01, "PINCTRL_INTEL");
+
+const struct software_node cherryview_gpio_node_02 = {
+ .name = "INT33FF:02",
+};
+EXPORT_SYMBOL_NS_GPL(cherryview_gpio_node_02, "PINCTRL_INTEL");
+
+const struct software_node cherryview_gpio_node_03 = {
+ .name = "INT33FF:03",
+};
+EXPORT_SYMBOL_NS_GPL(cherryview_gpio_node_03, "PINCTRL_INTEL");
+
+static const struct software_node *chv_gpio_node_group[] = {
+ &cherryview_gpio_node_00,
+ &cherryview_gpio_node_01,
+ &cherryview_gpio_node_02,
+ &cherryview_gpio_node_03,
+ NULL
+};
+
+static struct software_node_auto_secondary chv_auto_secondary = {
+ .node_group = chv_gpio_node_group,
+ .bus = &platform_bus_type,
+};
+
static int __init chv_pinctrl_init(void)
{
- return platform_driver_register(&chv_pinctrl_driver);
+ int ret;
+
+ ret = software_node_register_auto_secondary(&chv_auto_secondary);
+ if (ret)
+ return ret;
+
+ ret = platform_driver_register(&chv_pinctrl_driver);
+ if (ret)
+ software_node_unregister_auto_secondary(&chv_auto_secondary);
+
+ return ret;
}
subsys_initcall(chv_pinctrl_init);

static void __exit chv_pinctrl_exit(void)
{
platform_driver_unregister(&chv_pinctrl_driver);
+ software_node_unregister_auto_secondary(&chv_auto_secondary);
}
module_exit(chv_pinctrl_exit);

diff --git a/include/linux/pinctrl/intel.h b/include/linux/pinctrl/intel.h
index d45f090adc1f532f866c98aeca144a4d83fa28f4..bd3e6ee8b15ebc492275a14ae6d53827b701f783 100644
--- a/include/linux/pinctrl/intel.h
+++ b/include/linux/pinctrl/intel.h
@@ -9,4 +9,9 @@ extern const struct software_node baytrail_gpio_node_00;
extern const struct software_node baytrail_gpio_node_01;
extern const struct software_node baytrail_gpio_node_02;

+extern const struct software_node cherryview_gpio_node_00;
+extern const struct software_node cherryview_gpio_node_01;
+extern const struct software_node cherryview_gpio_node_02;
+extern const struct software_node cherryview_gpio_node_03;
+
#endif /* __LINUX_PINCTRL_INTEL_H */

--
2.47.3