Re: [PATCH v5 1/5] pinctrl: renesas: rzg2l: Generalize the power source code

Wolfram Sang <[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 <aovm28-a5inxl8CY@ninjato>
On Wed, Aug 19, 2026 at 05:35:49PM +0300, Claudiu Beznea 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]>

Tested-by: Wolfram Sang <[email protected]>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmqL5tsACgkQFA3kzBSg
Kbb5FhAAokskPZvLetM1Z7gooANHcXEbCoKbx1a6wxufzwYt1AbT+vN1nCBqmLKn
W5YH4WXfajh5Y72dLjeMLmSjJ86xDKConT1ShmGqhxfVQQqQR8pUVCJ6UcjBGkqg
+SLbzMGFeLPFMHB0S6N6aB8TTdqFyggwGrJoXwAqggX7tTYjve8kWmV42Bnt0TmQ
WP/qstjy3Kocm8d7LGpKSPwuRLhYK0+x2/lIR4nMO/alV53aYjjcIh0o4xsobJXt
Aeqg8yURXqpn+Lz49TuEMtDhslM6EesxmLYyytZ+RNEItQWnpObQKQ5SorMG2k+u
rSWf7zkd1XCM2yy8/Uy3RZB8l0+cDZFzBcDBTkQ5mOY/ftVDZh4mWBsWWWOX/wTK
9DRVQ+mGNIZBPJJgJTSQrPlj7DUyp8jASXURdylE6drdvHu+JG58ik0VIl0HUcuQ
nJg/Shh/tFt6Zm5v6pRntPdEX0DFc9qEsoyFtK4SbkGPnZSpGscJFdXk4qUaWU85
QraWGmhSeMGMzKlUbKOr2z75KKGMzpx5qXa5v09PNkZhyJm37/+dio6vN38hb1KE
7VvMZb7JmGhw+lhOk9yuxQEjsvFDyXcvzUsZy1T+V2I45QeuJRIv+ej6dDU1U+aW
EtGWc21F3PuDzyh8jbk3fseRHpxHhzvI6LKHB6Jdn0l0Yc/aeCQ=
=sp0m
-----END PGP SIGNATURE-----
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.