]> git.ipfire.org Git - thirdparty/u-boot.git/commit
clk: mediatek: add separate gates_offs for cg gates
authorDavid Lechner <dlechner@baylibre.com>
Wed, 7 Jan 2026 16:21:09 +0000 (10:21 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 12 Jan 2026 19:35:03 +0000 (13:35 -0600)
commita694df199a4246036497447479bc08c6c4c09534
treeb06e87f0a0c063f66e991c56859354e366ae455c
parent32087f61adae56e9e23d80f82567dbb6ce3e8e54
clk: mediatek: add separate gates_offs for cg gates

Add a gates_offs field to struct mtk_cg_priv and use that instead of
struct mtk_clk_tree.gates_offs.

Prior to this change, struct mtk_clk_tree.gates_offs could be the offset
of struct mtk_clk_tree.gates or struct mtk_cg_priv.gates depending on
the context. This was confusing and error-prone. For example, in mt8365
there is one set of gates that needs an offset and one that does not
that share the same struct mtk_clk_tree. This is fixed in this patch by
giving the correct offset for each gate separately.

Signed-off-by: David Lechner <dlechner@baylibre.com>
15 files changed:
drivers/clk/mediatek/clk-mt7622.c
drivers/clk/mediatek/clk-mt7623.c
drivers/clk/mediatek/clk-mt7629.c
drivers/clk/mediatek/clk-mt7981.c
drivers/clk/mediatek/clk-mt7986.c
drivers/clk/mediatek/clk-mt7987.c
drivers/clk/mediatek/clk-mt7988.c
drivers/clk/mediatek/clk-mt8183.c
drivers/clk/mediatek/clk-mt8188.c
drivers/clk/mediatek/clk-mt8365.c
drivers/clk/mediatek/clk-mt8512.c
drivers/clk/mediatek/clk-mt8516.c
drivers/clk/mediatek/clk-mt8518.c
drivers/clk/mediatek/clk-mtk.c
drivers/clk/mediatek/clk-mtk.h