summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Stephan <[email protected]>2026-07-15 16:28:36 +0200
committerDavid Lechner <[email protected]>2026-07-29 10:04:26 -0500
commit21aacf2979a63e02ad07616ff2319dc3f6f7886d (patch)
treeab469f16787e43ff87db4f44ee336b5b9e76aee9
parente1fdd94f78fecd2bd4706bf1efbcf0ea896b24c0 (diff)
clk: mediatek: mt7629: use driver data to store the clock tree
Pass each controller's struct mtk_clk_tree through the driver data and use the generic probe function for all the MT7629 clock drivers, instead of a dedicated probe per controller. The apmixedsys and topckgen controllers keep their own U_BOOT_DRIVER since they rely on dedicated ops and on the parent bind() callback, but they now get their tree from the compatible data. The apmixedsys probe still performs its SoC specific register tweaks. No functional change intended. Signed-off-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/20260715-b4-mtk-clk-cleanup-clock-gate-drivers-v2-8-23e907516010@baylibre.com Signed-off-by: David Lechner <[email protected]>
-rw-r--r--drivers/clk/mediatek/clk-mt7629.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/clk/mediatek/clk-mt7629.c b/drivers/clk/mediatek/clk-mt7629.c
index dd546a4ad42..f7a5f9f75ce 100644
--- a/drivers/clk/mediatek/clk-mt7629.c
+++ b/drivers/clk/mediatek/clk-mt7629.c
@@ -654,9 +654,10 @@ static int mt7629_mcucfg_probe(struct udevice *dev)
static int mt7629_apmixedsys_probe(struct udevice *dev)
{
struct mtk_clk_priv *priv = dev_get_priv(dev);
+ const struct mtk_clk_tree *tree = (void *)dev_get_driver_data(dev);
int ret;
- ret = mtk_common_clk_init(dev, &mt7629_apmixed_clk_tree);
+ ret = mtk_common_clk_init(dev, tree);
if (ret)
return ret;
@@ -668,11 +669,6 @@ static int mt7629_apmixedsys_probe(struct udevice *dev)
return 0;
}
-static int mt7629_topckgen_probe(struct udevice *dev)
-{
- return mtk_common_clk_init(dev, &mt7629_topckgen_clk_tree);
-}
-
static int mt7629_clk_probe(struct udevice *dev)
{
const struct mtk_clk_tree *tree = (void *)dev_get_driver_data(dev);
@@ -694,12 +690,18 @@ static int mt7629_ethsys_bind(struct udevice *dev)
}
static const struct udevice_id mt7629_apmixed_compat[] = {
- { .compatible = "mediatek,mt7629-apmixedsys" },
+ {
+ .compatible = "mediatek,mt7629-apmixedsys",
+ .data = (ulong)&mt7629_apmixed_clk_tree,
+ },
{ }
};
static const struct udevice_id mt7629_topckgen_compat[] = {
- { .compatible = "mediatek,mt7629-topckgen" },
+ {
+ .compatible = "mediatek,mt7629-topckgen",
+ .data = (ulong)&mt7629_topckgen_clk_tree,
+ },
{ }
};
@@ -764,7 +766,7 @@ U_BOOT_DRIVER(mt7629_clk_topckgen) = {
.id = UCLASS_CLK,
.of_match = mt7629_topckgen_compat,
.bind = mtk_common_clk_parent_bind,
- .probe = mt7629_topckgen_probe,
+ .probe = mt7629_clk_probe,
.priv_auto = sizeof(struct mtk_clk_priv),
.ops = &mtk_clk_topckgen_ops,
.flags = DM_FLAG_PRE_RELOC,