]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: rk: use rk_encode_wm16() for clock selection
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 4 Feb 2026 09:14:38 +0000 (09:14 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Feb 2026 17:20:38 +0000 (09:20 -0800)
commit5c1fc7cb81dfed0c84ae19b1022d8ca977bd6f5d
tree17ecd015493afd2b612d1252fc55e2d8aaf3095a
parentd7d92037cbd82ac6581ef9c97f14d2432f921fba
net: stmmac: rk: use rk_encode_wm16() for clock selection

Use rk_encode_wm16() for RMII clock gating control, and also for the
io_clksel bit used to select the transmit clock between CRU-derived
and IO-derived clock sources.

Both of these were configured via the "set_clock_selection" method in
the SoC specific operations, but there is no requirement to change the
io_clksel except when enabling clocks.

It is also possible that we don't need to ungate the RMII clock if we
are operating in RGMII mode, but this commit makes no change there.

Split up the configuration of these as separate functions, and remove
the set_clock_selection() method. Since these clocking bits are in the
same register that we call the "speed" register, move the logic for
writing that register into rk_write_speed_grf_reg().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Heiko Stuebner <heiko@sntech.de> #px30,rk3328,rk3568,rk3588
Link: https://patch.msgid.link/E1vnYy6-00000007hp9-1AJM@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c