[PATCH 2/4] pinctrl: intel: expose software nodes for baytrail GPIO devices

From: Bartosz Golaszewski

Date: Thu Mar 19 2026 - 12:22:45 EST


Use the new automatic secondary fwnode API to ensure that when the
baytrail 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.

Create a new header under linux/pinctrl/ containing intel-specific
symbols and declare the new variables there.

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

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 02fdadf2189afb0ff654c80c131f813b59d623d6..bd0ba7c3351c021584127b3679c59d7463cc8a57 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -22,6 +22,7 @@
#include <linux/seq_file.h>
#include <linux/string_helpers.h>

+#include <linux/pinctrl/intel.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/pinconf.h>
@@ -1723,9 +1724,46 @@ static struct platform_driver byt_gpio_driver = {
},
};

+const struct software_node baytrail_gpio_node_00 = {
+ .name = "INT33FC:00",
+};
+EXPORT_SYMBOL_NS_GPL(baytrail_gpio_node_00, "PINCTRL_INTEL");
+
+const struct software_node baytrail_gpio_node_01 = {
+ .name = "INT33FC:01",
+};
+EXPORT_SYMBOL_NS_GPL(baytrail_gpio_node_01, "PINCTRL_INTEL");
+
+const struct software_node baytrail_gpio_node_02 = {
+ .name = "INT33FC:02",
+};
+EXPORT_SYMBOL_NS_GPL(baytrail_gpio_node_02, "PINCTRL_INTEL");
+
+static const struct software_node *baytrail_gpio_node_group[] = {
+ &baytrail_gpio_node_00,
+ &baytrail_gpio_node_01,
+ &baytrail_gpio_node_02,
+ NULL
+};
+
+static struct software_node_auto_secondary byt_auto_secondary = {
+ .node_group = baytrail_gpio_node_group,
+ .bus = &platform_bus_type,
+};
+
static int __init byt_gpio_init(void)
{
- return platform_driver_register(&byt_gpio_driver);
+ int ret;
+
+ ret = software_node_register_auto_secondary(&byt_auto_secondary);
+ if (ret)
+ return ret;
+
+ ret = platform_driver_register(&byt_gpio_driver);
+ if (ret)
+ software_node_unregister_auto_secondary(&byt_auto_secondary);
+
+ return ret;
}
subsys_initcall(byt_gpio_init);

diff --git a/include/linux/pinctrl/intel.h b/include/linux/pinctrl/intel.h
new file mode 100644
index 0000000000000000000000000000000000000000..d45f090adc1f532f866c98aeca144a4d83fa28f4
--- /dev/null
+++ b/include/linux/pinctrl/intel.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __LINUX_PINCTRL_INTEL_H
+#define __LINUX_PINCTRL_INTEL_H
+
+struct software_node;
+
+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;
+
+#endif /* __LINUX_PINCTRL_INTEL_H */

--
2.47.3