pinctrl: exynos: bind GPIO driver along with pinctrl
authorKaustabh Chakraborty <kauschluss@disroot.org>
Fri, 17 Oct 2025 15:27:40 +0000 (20:57 +0530)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 12 Nov 2025 04:57:51 +0000 (13:57 +0900)
The devicetree of Samsung devices typically have the pin controller and
GPIO bank descriptors under the same pinctrl node. In U-Boot, these are
handled by two separate drivers. It is not possible to invoke both
drivers from a single node compatible.

Bind the GPIO driver on pinctrl driver bind, with the same OF node as
the pinctrl driver. This solution is already being used in other pinctrl
drivers. The hierarchy, as represented in `dm tree`, is as follows:

  pinctrl@13750000
  |-- gpio-banks
  |   |-- gpr0-gpio-bank
  |   |-- gpr1-gpio-bank
  |   |-- gpr2-gpio-bank
  |   |-- gpr3-gpio-bank
  |   `-- gpr4-gpio-bank
  |-- sd0-bus-width1-pins
  |-- sd0-bus-width4-pins
  |-- sd0-bus-width8-pins
  `-- sd0-clk-pins

Since a bind function doesn't exist, create and add it to all pinctrl
drivers.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/pinctrl/exynos/pinctrl-exynos.c
drivers/pinctrl/exynos/pinctrl-exynos.h
drivers/pinctrl/exynos/pinctrl-exynos7420.c
drivers/pinctrl/exynos/pinctrl-exynos78x0.c
drivers/pinctrl/exynos/pinctrl-exynos850.c

index b37282f..4c06b41 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <log.h>
 #include <dm.h>
+#include <dm/lists.h>
 #include <errno.h>
 #include <asm/io.h>
 #include "pinctrl-exynos.h"
@@ -178,3 +179,13 @@ int exynos_pinctrl_probe(struct udevice *dev)
 
        return 0;
 }
+
+int exynos_pinctrl_bind(struct udevice *dev)
+{
+       /*
+        * Attempt to bind the Exynos GPIO driver. The GPIOs and
+        * pin controller descriptors are found in the same OF node.
+        */
+       return device_bind_driver_to_node(dev, "gpio_exynos", "gpio-banks",
+                                         dev_ofnode(dev), NULL);
+}
index da66677..73cc2ce 100644 (file)
@@ -97,5 +97,6 @@ void exynos_pinctrl_setup_peri(struct exynos_pinctrl_config_data *conf,
 int exynos_pinctrl_set_state(struct udevice *dev,
                struct udevice *config);
 int exynos_pinctrl_probe(struct udevice *dev);
+int exynos_pinctrl_bind(struct udevice *dev);
 
 #endif /* __PINCTRL_EXYNOS_H_ */
index 8fdf607..b1d983f 100644 (file)
@@ -114,4 +114,5 @@ U_BOOT_DRIVER(pinctrl_exynos7420) = {
        .priv_auto      = sizeof(struct exynos_pinctrl_priv),
        .ops            = &exynos7420_pinctrl_ops,
        .probe          = exynos_pinctrl_probe,
+       .bind           = exynos_pinctrl_bind,
 };
index 61b9844..cc01028 100644 (file)
@@ -115,4 +115,5 @@ U_BOOT_DRIVER(pinctrl_exynos78x0) = {
        .priv_auto = sizeof(struct exynos_pinctrl_priv),
        .ops            = &exynos78x0_pinctrl_ops,
        .probe          = exynos_pinctrl_probe,
+       .bind           = exynos_pinctrl_bind,
 };
index 3ec2636..5bf09ae 100644 (file)
@@ -122,4 +122,5 @@ U_BOOT_DRIVER(pinctrl_exynos850) = {
        .priv_auto      = sizeof(struct exynos_pinctrl_priv),
        .ops            = &exynos850_pinctrl_ops,
        .probe          = exynos_pinctrl_probe,
+       .bind           = exynos_pinctrl_bind,
 };