pinctrl: renesas: rzg2l: Adapt function number for RZ/G3S
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Fri, 29 Sep 2023 05:39:03 +0000 (08:39 +0300)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 13 Oct 2023 07:38:05 +0000 (09:38 +0200)
commit35a3610e5a2407913dd6505de06975ba5056af9e
tree5e67264e2b1eebec2ef6c79a065d1ea1492c1846
parent1f89aa906fac1d569ecf8f427b1edca6e26fa472
pinctrl: renesas: rzg2l: Adapt function number for RZ/G3S

On RZ/G3S PFC register allow setting 8 functions for individual ports
(function1 to function8). For function1 the register need to be
configured with 0, for function8 the register need to be configured with
7.  We cannot use zero based addressing when requesting functions from
different code places as the documentation
(RZG3S_pinfunction_List_r1.0.xlsx) states explicitly that function0 is
GPIO.

Add a new member to struct rzg2l_hwcfg that will keep the offset that
needs to be substracted before applying a value to a PFC register.

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/20230929053915.1530607-17-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl-rzg2l.c