[PATCH v2 03/24] clk: mediaTek: mt7622: add clock tree type flags
David Lechner
dlechner at baylibre.com
Fri Jul 10 20:56:19 CEST 2026
Add clock tree type flags to the mt7622 clock tree structures. These
will be used later for parent lookup.
Signed-off-by: David Lechner <dlechner at baylibre.com>
---
drivers/clk/mediatek/clk-mt7622.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/clk/mediatek/clk-mt7622.c b/drivers/clk/mediatek/clk-mt7622.c
index 60f4a872a66..aba870bf0f3 100644
--- a/drivers/clk/mediatek/clk-mt7622.c
+++ b/drivers/clk/mediatek/clk-mt7622.c
@@ -613,6 +613,21 @@ static const struct mtk_clk_tree mt7622_apmixed_clk_tree = {
.gates = apmixed_cgs,
.num_plls = ARRAY_SIZE(apmixed_plls),
.num_gates = ARRAY_SIZE(apmixed_cgs),
+ .type = MTK_CLK_TREE_APMIXED,
+};
+
+static const struct mtk_clk_tree mt7622_topckgen_clk_tree = {
+ .ext_clk_rates = ext_clock_rates,
+ .num_ext_clks = ARRAY_SIZE(ext_clock_rates),
+ .fdivs_offs = CLK_TOP_TO_USB3_SYS,
+ .muxes_offs = CLK_TOP_AXI_SEL,
+ .fclks = top_fixed_clks,
+ .fdivs = top_fixed_divs,
+ .muxes = top_muxes,
+ .num_fclks = ARRAY_SIZE(top_fixed_clks),
+ .num_fdivs = ARRAY_SIZE(top_fixed_divs),
+ .num_muxes = ARRAY_SIZE(top_muxes),
+ .type = MTK_CLK_TREE_TOPCKGEN,
};
static const struct mtk_clk_tree mt7622_infra_clk_tree = {
@@ -640,14 +655,6 @@ static const struct mtk_clk_tree mt7622_peri_clk_tree = {
static const struct mtk_clk_tree mt7622_clk_tree = {
.ext_clk_rates = ext_clock_rates,
.num_ext_clks = ARRAY_SIZE(ext_clock_rates),
- .fdivs_offs = CLK_TOP_TO_USB3_SYS,
- .muxes_offs = CLK_TOP_AXI_SEL,
- .fclks = top_fixed_clks,
- .fdivs = top_fixed_divs,
- .muxes = top_muxes,
- .num_fclks = ARRAY_SIZE(top_fixed_clks),
- .num_fdivs = ARRAY_SIZE(top_fixed_divs),
- .num_muxes = ARRAY_SIZE(top_muxes),
};
static int mt7622_mcucfg_probe(struct udevice *dev)
@@ -687,7 +694,7 @@ static int mt7622_apmixedsys_probe(struct udevice *dev)
static int mt7622_topckgen_probe(struct udevice *dev)
{
- return mtk_common_clk_init(dev, &mt7622_clk_tree);
+ return mtk_common_clk_init(dev, &mt7622_topckgen_clk_tree);
}
static int mt7622_infracfg_probe(struct udevice *dev)
@@ -807,6 +814,7 @@ U_BOOT_DRIVER(mtk_clk_apmixedsys) = {
.name = "mt7622-clock-apmixedsys",
.id = UCLASS_CLK,
.of_match = mt7622_apmixed_compat,
+ .bind = mtk_common_clk_parent_bind,
.probe = mt7622_apmixedsys_probe,
.priv_auto = sizeof(struct mtk_clk_priv),
.ops = &mtk_clk_apmixedsys_ops,
@@ -817,6 +825,7 @@ U_BOOT_DRIVER(mtk_clk_topckgen) = {
.name = "mt7622-clock-topckgen",
.id = UCLASS_CLK,
.of_match = mt7622_topckgen_compat,
+ .bind = mtk_common_clk_parent_bind,
.probe = mt7622_topckgen_probe,
.priv_auto = sizeof(struct mtk_clk_priv),
.ops = &mtk_clk_topckgen_ops,
--
2.43.0
More information about the U-Boot
mailing list