This series adds more code cleanup in the MediaTek clocks drivers. - add missing static identifier to MT8188 clock tree before refactoring them using GATE_CLK_TREE (see below)
- MT8189 already defines GATE_CLK_TREE to factor the boilerplate needed to define a mtk_clk_tree. Move the macro to clk-mtk.h so it can be shared by other drivers, turning 150 lines of open-coded clock trees into 26. - As a leftover from the previous cleanup, some drivers still register separate drivers for clk_topckgen and the other clock gates. Merge these into a single driver where applicable. The series deliberately only touches the MT8xxx drivers: they are the ones the Genio boards are based on, so they are the ones we can actually test. The MT76xx/MT79xx drivers show the same patterns (open-coded clock trees, separate topckgen and clock gate drivers), but as we have no way to test them here, they are left for a follow-up. Build tested with the command: ❯ ./tools/buildman/buildman -o /tmp/b -b b4/clk-mediatek-cleanups -CveW --boards mt8183_pumpkin,mt8370_genio_510_evk,mt8390_genio_700_evk,mt8371_genio_520_evk,mt8391_genio_720_evk,mt8395_genio_1200_evk,mt8365_evk,mt8366_genio_360_evk,mt8512_bm1_emmc,mt8516_pumpkin,mt8518_ap1_emmc Building 13 commits for 11 boards (11 threads, 2 jobs per thread) 143 0 0 /143 Completed: 143 total built Signed-off-by: Julien Stephan <[email protected]> --- Julien Stephan (11): clk: mediatek: mt8188: make the clock trees static clk: mediatek: add a helper to declare gate-only clock trees clk: mediatek: use MTK_GATE_CLK_TREE() for the gate-only clock trees clk: mediatek: mt8183: merge the clock drivers into a single driver clk: mediatek: mt8188: merge the clock drivers into a single driver clk: mediatek: mt8189: merge the clock drivers into a single driver clk: mediatek: mt8195: merge the clock drivers into a single driver clk: mediatek: mt8365: merge the clock drivers into a single driver clk: mediatek: mt8512: merge the clock drivers into a single driver clk: mediatek: mt8516: merge the clock drivers into a single driver clk: mediatek: mt8518: merge the clock drivers into a single driver drivers/clk/mediatek/clk-mt8183.c | 29 +++----------- drivers/clk/mediatek/clk-mt8188.c | 81 ++++++-------------------------------- drivers/clk/mediatek/clk-mt8189.c | 82 +++++++++++++++++++-------------------- drivers/clk/mediatek/clk-mt8195.c | 29 +++----------- drivers/clk/mediatek/clk-mt8365.c | 29 +++----------- drivers/clk/mediatek/clk-mt8366.c | 64 +++++------------------------- drivers/clk/mediatek/clk-mt8512.c | 38 ++++-------------- drivers/clk/mediatek/clk-mt8516.c | 31 +++------------ drivers/clk/mediatek/clk-mt8518.c | 31 +++------------ drivers/clk/mediatek/clk-mtk.h | 22 +++++++++++ 10 files changed, 117 insertions(+), 319 deletions(-) --- base-commit: 58badc5b2d377ded320c24f8d000ea3423405ace change-id: 20260917-clk-mediatek-cleanups-ebdb2cac446b Best regards, -- Julien Stephan <[email protected]>
