]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: pcs: rzn1-miic: Add per-SoC control for MIIC register unlock/lock
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 10 Sep 2025 20:41:29 +0000 (21:41 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 16 Sep 2025 00:44:36 +0000 (17:44 -0700)
commit419747319e3a138ed3ee862fe9b66aa1735ae3bf
treee47db1f5eb40aaaa6f3f82186e24dbec7b0f1f32
parent882a8bb0706c0c3af6b33858bcad630cf61fe894
net: pcs: rzn1-miic: Add per-SoC control for MIIC register unlock/lock

Make MIIC accessory register unlock/lock behaviour selectable via SoC/OF
data. Add init_unlock_lock_regs and miic_write to struct miic_of_data so
the driver can either perform the traditional global unlock sequence (as
used on RZ/N1) or use a different policy for other SoCs (for example
RZ/T2H, which does not require leaving registers unlocked).

miic_reg_writel() now calls the per-SoC miic_write callback to perform
register writes. Provide miic_reg_writel_unlocked() as the default writer
and set it for the RZ/N1 OF data so existing platforms keep the same
behaviour. Add a miic_unlock_regs() helper that implements the accessory
register unlock sequence so the unlock/lock sequence can be reused where
needed (for example when a SoC requires explicit unlock/lock around
individual accesses).

This change is preparatory work for supporting RZ/T2H.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://patch.msgid.link/20250910204132.319975-9-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/pcs/pcs-rzn1-miic.c