pinctrl: renesas: rzg2l: Add support to select power source for Ethernet pins
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Thu, 7 Dec 2023 07:06:54 +0000 (09:06 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 15 Dec 2023 10:34:34 +0000 (11:34 +0100)
commit51996952b8b50942ed3069141ebc1dee13756b95
tree4347e0fe8c33dc132b33f9ec5e067af8a620ce67
parentd3aaa7203a17e8399df41e7c3f088f51368b001c
pinctrl: renesas: rzg2l: Add support to select power source for Ethernet pins

The GPIO controller available on RZ/G3S (but also on RZ/G2L) supports
setting the power source for Ethernet pins.  Based on the interface b/w
the Ethernet controller and the Ethernet PHY, and on board design, a
specific power source needs to be selected.  The GPIO controller
supports 1.8V, 2.5V, and 3.3V power source selection for the Ethernet
pins.  This can be selected though the ETHx_POC registers (x={0, 1}).

Adjust the driver to support this, and to do proper instantiation for
the RZ/G3S and RZ/G2L SoCs.  On RZ/G2L only the get operation has been
tested at the moment.

While at it, as the power registers on RZ/G2L support access sizes of 8
bits, and these registers on RZ/G3S support access sizes of 8/16/32
bits, replace writel()/readl() on these registers with writeb()/readb().
This should allow us to use the same code on both SoCs w/o any issues.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231207070700.4156557-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl-rzg2l.c