pinctrl: renesas: rzg2l: Unify OEN access by making pin-to-bit mapping configurable
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 6 Aug 2025 19:55:51 +0000 (20:55 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 Aug 2025 09:44:40 +0000 (11:44 +0200)
commita3455a0c24834eaa20f032b214d53b1607d60073
tree834519e7123fac652ae5b18a158dbbc585f4bf71
parent27c76cc93c6c2ee6c0d7fec6dedc1214a977e66f
pinctrl: renesas: rzg2l: Unify OEN access by making pin-to-bit mapping configurable

Refactor the RZG2L pinctrl driver to support reuse of the common
rzg2l_read_oen() and rzg2l_write_oen() helpers across SoCs with
different output-enable (OEN) bit mappings.

Introduce a new `pin_to_oen_bit` callback in `struct rzg2l_pinctrl_data`
to allow SoCs to provide custom logic for mapping a pin to its OEN bit.
Update the generic OEN read/write paths to use this callback when present.

With this change, SoCs like RZ/G3S can reuse the common OEN handling
code by simply supplying their own `pin_to_oen_bit` implementation.
The previously duplicated `rzg3s_oen_read()` and `rzg3s_oen_write()`
functions are now removed.

This improves maintainability and prepares the driver for supporting
future SoCs with minimal duplication.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250806195555.1372317-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/renesas/pinctrl-rzg2l.c