Re: [PATCH 01/17] pinctrl: renesas: r906g032: handle pin subgroups

Marek Vasut via U-Boot <[email protected]> Sun, 2 Aug 2026 05:30:16 +0200
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <[email protected]>
On 7/31/26 6:33 PM, Ralph Siemsen wrote:
> Add simple recursion support to the .set_state method. This makes it
> possible to use subbroups

subgroups (typo)

> in the device tree, which in turn allows
> setting multiple pins with different bias/drive-strength properies.

properties (another typo)

> Fixes: e4aea57fa773 ("pinctrl: renesas: add R906G032 driver")
> Signed-off-by: Ralph Siemsen <[email protected]>
> ---
>   drivers/pinctrl/renesas/pinctrl-rzn1.c | 15 +++++++++++++--
>   1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
> index fdc43c8e714..8b13a2cea75 100644
> --- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
> @@ -298,6 +298,7 @@ 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;
> @@ -317,8 +318,6 @@ static int rzn1_pinctrl_set_state(struct udevice *dev, struct udevice *config)
>   
>   	/* Number of pins */
>   	ret = dev_read_size(config, "pinmux");
> -	if (ret < 0)
> -		return ret;

Is this removal of error checking correct ?

>   	size = ret / sizeof(val);
>   
> @@ -338,6 +337,18 @@ static int rzn1_pinctrl_set_state(struct udevice *dev, struct udevice *config)
>   		rzn1_hw_set_lock(priv, LOCK_ALL, 0);
>   	}
>   
> +	/*
> +	 * Handle subnodes recursively, so that pin groups work.
> +	 * Note that properties are *NOT* inherited from parent.
> +	 */
> +	for (device_find_first_child(config, &child);
> +	     child;
> +	     device_find_next_child(&child)) {

device_foreach_child() ?

> +		ret = rzn1_pinctrl_set_state(dev, child);
> +		if (ret)
> +			return ret;
> +	}
> +
>   	return 0;
[...]