U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pinctrl: renesas: r906g032: handle pin subgroups
@ 2026-08-14 18:26 Ralph Siemsen
  2026-08-14 22:00 ` Marek Vasut via U-Boot
  0 siblings, 1 reply; 4+ messages in thread
From: Ralph Siemsen @ 2026-08-14 18:26 UTC (permalink / raw)
  To: Marek Vasut, u-boot; +Cc: Nobuhiro Iwamatsu, Tom Rini, Ralph Siemsen

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 <ralph.siemsen@linaro.org>
---
Changes in v2:
- split out of the series "Renesas RZ/N1 additional drivers"
  https://lore.kernel.org/u-boot/20260731-rzn1-2026-07-v1-1-af2ce80db9d8@linaro.org/
- 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 <ralph.siemsen@linaro.org>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-16 23:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 18:26 [PATCH v2] pinctrl: renesas: r906g032: handle pin subgroups Ralph Siemsen
2026-08-14 22:00 ` Marek Vasut via U-Boot
2026-08-15 13:53   ` Ralph Siemsen
2026-08-16 12:07     ` Marek Vasut via U-Boot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox