clk: rockchip: introduce GRF gates
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Fri, 2 May 2025 11:03:09 +0000 (13:03 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 5 May 2025 20:39:24 +0000 (22:39 +0200)
commite277168cabe9fd99e647f5dad0bc846d5d6b0093
treeb8b0194e9a4c0f067b11b20d7fb3d4b4b2426034
parent70a114daf2077472e58b3cac23ba8998e35352f4
clk: rockchip: introduce GRF gates

Some rockchip SoCs, namely the RK3576, have bits in a General Register
File (GRF) that act just like clock gates. The downstream vendor kernel
simply maps over the already mapped GRF range with a generic clock gate
driver. This solution isn't suitable for upstream, as a memory range
will be in use by multiple drivers at the same time, and it leaks
implementation details into the device tree.

Instead, implement this with a new clock branch type in the Rockchip
clock driver: GRF gates. Somewhat akin to MUXGRF, this clock branch
depends on the type of GRF, but functions like a gate instead.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Link: https://lore.kernel.org/r/20250502-rk3576-sai-v3-3-376cef19dd7c@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/clk/rockchip/Makefile
drivers/clk/rockchip/clk.c
drivers/clk/rockchip/clk.h
drivers/clk/rockchip/gate-grf.c [new file with mode: 0644]