Re: [PATCH v2 1/7] pinctrl: renesas: rzg2l: Generalize the power source code

From: Claudiu Beznea

Date: Wed Jun 03 2026 - 04:34:04 EST




On 6/2/26 23:48, Wolfram Sang wrote:
On Thu, May 28, 2026 at 11:04:33AM +0300, Claudiu Beznea wrote:
From: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>

The current functions used to get/set the pin power source check the
OTHER_POC register, which is specific to the RZ/G3L SoC only. To allow the
code to be extended for other power source functionalities (e.g. I3C on
RZ/G3S), generalize the functions used to get/set the pin power source.

For this, introduce the struct rzg2l_register_masks data structure whose
purpose is to store SoC specific register bit masks. The members of this
structure are then used in rzg2l_caps_to_pwr_reg() to retrieve the bitmask
corresponding to a SoC specific power source capability.

The conversion between HW specific power source values and SW specific
power source values is now handled through rzg2l_pwr_reg_val_to_ps() and
rzg2l_ps_to_pwr_reg_val().

Finally, to keep the code generic, the register update in
rzg2l_set_power_source() was changed to a read-modify-write approach to
cover all cases.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>

Tested-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

Have you seen the comment from Sashiko about this patch? Doesn't sound
entirely wrong to me...

Indeed, that should be fixed. I'll add a fix patch in the next version.

Thank you for testing this,
Claudiu