[PATCH v2] pinctrl: renesas: r906g032: handle pin subgroups

Ralph Siemsen <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <20260814-rzn1-2026-10-pinctrl-v2-1-95dec872b1ca__44321.1507679493$1786732080$gmane$org@linaro.org>
Add simple recursion support to the .set_state method. This makes it
possible to use subgroups in the device tree, which in turn allows
setting multiple pins with different bias/drive-strength properties.

Fixes: e4aea57fa773 ("pinctrl: renesas: add R906G032 driver")
Signed-off-by: Ralph Siemsen <[email protected]>
---
Changes in v2:
- split out of the series "Renesas RZ/N1 additional drivers"
  https://lore.kernel.org/u-boot/[email protected]/
- fix typos in commit message
- use device_foreach_child() to iterate child nodes
- move recursion to top of function, ahead of the early return in the
  case of no direct pinmux entries, instead of removing early return.
- dev_err() in case of failure during recursion
---
 drivers/pinctrl/renesas/pinctrl-rzn1.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
index fdc43c8e714..6c8d40e9639 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
@@ -298,11 +298,24 @@ static int rzn1_pinconf_set(struct rzn1_pinctrl_priv *priv, unsigned int pin,
 static int rzn1_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 {
 	struct rzn1_pinctrl_priv *priv = dev_get_priv(dev);
+	struct udevice *child;
 	int size;
 	int ret;
 	u32 val;
 	u32 bias;
 
+	/*
+	 * Handle subnodes recursively, so that pin groups work.
+	 * Note that properties are *NOT* inherited from parent.
+	 */
+	device_foreach_child(child, config) {
+		ret = rzn1_pinctrl_set_state(dev, child);
+		if (ret) {
+			dev_err(dev, "failed node '%s'\n", child->name);
+			return ret;
+		}
+	}
+
 	/* Pullup/down bias, common to all pins in group */
 	bias = PIN_CONFIG_BIAS_PULL_UP;
 	if (dev_read_bool(config, "bias-disable"))

---
base-commit: 36c377b9859ffb53eb1e39ea31e8d96d1e0fe1e5
change-id: 20260810-rzn1-2026-10-pinctrl-cf97d3baf307

Best regards,
--  
Ralph Siemsen <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.