Re: [PATCH v5 1/5] pinctrl: renesas: rzg2l: Generalize the power source code
Geert Uytterhoeven <[email protected]>
| Newsgroups | org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAMuHMdXqsO4Y9g+mLdeq4LZ2sosR7r7hXP0swKtRFap4qU3zfw@mail.gmail.com> |
Hi Claudiu, On Wed, 19 Aug 2026 at 16:36, Claudiu Beznea <[email protected]> wrote: > From: Claudiu Beznea <[email protected]> > > 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 <[email protected]> > --- > > Changes in v5: > - in function rzg2l_ps_to_pwr_reg_val() return power source register > value or negative error; due to this, in rzg2l_set_power_source() > dropped the val local variable and use ret instead; due to this, > to be able to use ret on register setup, moved the rzg2l_ps_to_pwr_reg_val() > call after rzg2l_caps_to_pwr_reg() > - dropped the tags Reviewed-by: Geert Uytterhoeven <[email protected]> This does not apply to renesas-pinctrl-for-v7.4, so please rebase. Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds