1 From fe5c8d03f3de89ae058e365b783f8c1314f47490 Mon Sep 17 00:00:00 2001
2 From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
3 Date: Fri, 20 Jan 2023 10:20:33 +0100
4 Subject: [PATCH 01/15] clk: mediatek: clk-gate: Propagate struct device with
5 mtk_clk_register_gates()
7 Commit e4c23e19aa2a ("clk: mediatek: Register clock gate with device")
8 introduces a helper function for the sole purpose of propagating a
9 struct device pointer to the clk API when registering the mtk-gate
10 clocks to take advantage of Runtime PM when/where needed and where
11 a power domain is defined in devicetree.
13 Function mtk_clk_register_gates() then becomes a wrapper around the
14 new mtk_clk_register_gates_with_dev() function that will simply pass
15 NULL as struct device: this is essential when registering drivers
16 with CLK_OF_DECLARE instead of as a platform device, as there will
17 be no struct device to pass... but we can as well simply have only
18 one function that always takes such pointer as a param and pass NULL
21 This commit removes the mtk_clk_register_gates() wrapper and renames
22 mtk_clk_register_gates_with_dev() to the former and all of the calls
23 to either of the two functions were fixed in all drivers in order to
24 reflect this change; also, to improve consistency with other kernel
25 functions, the pointer to struct device was moved as the first param.
27 Since a lot of MediaTek clock drivers are actually registering as a
28 platform device, but were still registering the mtk-gate clocks
29 without passing any struct device to the clock framework, they've
30 been changed to pass a valid one now, as to make all those platforms
31 able to use runtime power management where available.
33 While at it, some much needed indentation changes were also done.
35 Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
36 Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
37 Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
38 Tested-by: Miles Chen <miles.chen@mediatek.com>
39 Link: https://lore.kernel.org/r/20230120092053.182923-4-angelogioacchino.delregno@collabora.com
40 Tested-by: Mingming Su <mingming.su@mediatek.com>
41 Signed-off-by: Stephen Boyd <sboyd@kernel.org>
43 [daniel@makrotopia.org: dropped parts not relevant for OpenWrt]
45 drivers/clk/mediatek/clk-gate.c | 23 +++++++---------------
46 drivers/clk/mediatek/clk-gate.h | 7 +------
47 drivers/clk/mediatek/clk-mt2701-aud.c | 4 ++--
48 drivers/clk/mediatek/clk-mt2701-eth.c | 4 ++--
49 drivers/clk/mediatek/clk-mt2701-g3d.c | 2 +-
50 drivers/clk/mediatek/clk-mt2701-hif.c | 4 ++--
51 drivers/clk/mediatek/clk-mt2701-mm.c | 4 ++--
52 drivers/clk/mediatek/clk-mt2701.c | 12 +++++------
53 drivers/clk/mediatek/clk-mt2712-mm.c | 4 ++--
54 drivers/clk/mediatek/clk-mt2712.c | 12 +++++------
55 drivers/clk/mediatek/clk-mt7622-aud.c | 4 ++--
56 drivers/clk/mediatek/clk-mt7622-eth.c | 8 ++++----
57 drivers/clk/mediatek/clk-mt7622-hif.c | 8 ++++----
58 drivers/clk/mediatek/clk-mt7622.c | 14 ++++++-------
59 drivers/clk/mediatek/clk-mt7629-eth.c | 7 ++++---
60 drivers/clk/mediatek/clk-mt7629-hif.c | 8 ++++----
61 drivers/clk/mediatek/clk-mt7629.c | 10 +++++-----
62 drivers/clk/mediatek/clk-mt7986-eth.c | 10 +++++-----
63 drivers/clk/mediatek/clk-mt7986-infracfg.c | 4 ++--
64 19 files changed, 68 insertions(+), 81 deletions(-)
66 --- a/drivers/clk/mediatek/clk-gate.c
67 +++ b/drivers/clk/mediatek/clk-gate.c
68 @@ -152,12 +152,12 @@ const struct clk_ops mtk_clk_gate_ops_no
70 EXPORT_SYMBOL_GPL(mtk_clk_gate_ops_no_setclr_inv);
72 -static struct clk_hw *mtk_clk_register_gate(const char *name,
73 +static struct clk_hw *mtk_clk_register_gate(struct device *dev, const char *name,
74 const char *parent_name,
75 struct regmap *regmap, int set_ofs,
76 int clr_ofs, int sta_ofs, u8 bit,
77 const struct clk_ops *ops,
78 - unsigned long flags, struct device *dev)
79 + unsigned long flags)
81 struct mtk_clk_gate *cg;
83 @@ -202,10 +202,9 @@ static void mtk_clk_unregister_gate(stru
87 -int mtk_clk_register_gates_with_dev(struct device_node *node,
88 - const struct mtk_gate *clks, int num,
89 - struct clk_hw_onecell_data *clk_data,
91 +int mtk_clk_register_gates(struct device *dev, struct device_node *node,
92 + const struct mtk_gate *clks, int num,
93 + struct clk_hw_onecell_data *clk_data)
97 @@ -229,13 +228,13 @@ int mtk_clk_register_gates_with_dev(stru
101 - hw = mtk_clk_register_gate(gate->name, gate->parent_name,
102 + hw = mtk_clk_register_gate(dev, gate->name, gate->parent_name,
107 gate->shift, gate->ops,
112 pr_err("Failed to register clk %s: %pe\n", gate->name,
113 @@ -261,14 +260,6 @@ err:
117 -EXPORT_SYMBOL_GPL(mtk_clk_register_gates_with_dev);
119 -int mtk_clk_register_gates(struct device_node *node,
120 - const struct mtk_gate *clks, int num,
121 - struct clk_hw_onecell_data *clk_data)
123 - return mtk_clk_register_gates_with_dev(node, clks, num, clk_data, NULL);
125 EXPORT_SYMBOL_GPL(mtk_clk_register_gates);
127 void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
128 --- a/drivers/clk/mediatek/clk-gate.h
129 +++ b/drivers/clk/mediatek/clk-gate.h
130 @@ -50,15 +50,10 @@ struct mtk_gate {
131 #define GATE_MTK(_id, _name, _parent, _regs, _shift, _ops) \
132 GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, _ops, 0)
134 -int mtk_clk_register_gates(struct device_node *node,
135 +int mtk_clk_register_gates(struct device *dev, struct device_node *node,
136 const struct mtk_gate *clks, int num,
137 struct clk_hw_onecell_data *clk_data);
139 -int mtk_clk_register_gates_with_dev(struct device_node *node,
140 - const struct mtk_gate *clks, int num,
141 - struct clk_hw_onecell_data *clk_data,
142 - struct device *dev);
144 void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
145 struct clk_hw_onecell_data *clk_data);
147 --- a/drivers/clk/mediatek/clk-mt2701-aud.c
148 +++ b/drivers/clk/mediatek/clk-mt2701-aud.c
149 @@ -127,8 +127,8 @@ static int clk_mt2701_aud_probe(struct p
151 clk_data = mtk_alloc_clk_data(CLK_AUD_NR);
153 - mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
155 + mtk_clk_register_gates(&pdev->dev, node, audio_clks,
156 + ARRAY_SIZE(audio_clks), clk_data);
158 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
160 --- a/drivers/clk/mediatek/clk-mt2701-eth.c
161 +++ b/drivers/clk/mediatek/clk-mt2701-eth.c
162 @@ -51,8 +51,8 @@ static int clk_mt2701_eth_probe(struct p
164 clk_data = mtk_alloc_clk_data(CLK_ETHSYS_NR);
166 - mtk_clk_register_gates(node, eth_clks, ARRAY_SIZE(eth_clks),
168 + mtk_clk_register_gates(&pdev->dev, node, eth_clks,
169 + ARRAY_SIZE(eth_clks), clk_data);
171 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
173 --- a/drivers/clk/mediatek/clk-mt2701-g3d.c
174 +++ b/drivers/clk/mediatek/clk-mt2701-g3d.c
175 @@ -45,7 +45,7 @@ static int clk_mt2701_g3dsys_init(struct
177 clk_data = mtk_alloc_clk_data(CLK_G3DSYS_NR);
179 - mtk_clk_register_gates(node, g3d_clks, ARRAY_SIZE(g3d_clks),
180 + mtk_clk_register_gates(&pdev->dev, node, g3d_clks, ARRAY_SIZE(g3d_clks),
183 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
184 --- a/drivers/clk/mediatek/clk-mt2701-hif.c
185 +++ b/drivers/clk/mediatek/clk-mt2701-hif.c
186 @@ -48,8 +48,8 @@ static int clk_mt2701_hif_probe(struct p
188 clk_data = mtk_alloc_clk_data(CLK_HIFSYS_NR);
190 - mtk_clk_register_gates(node, hif_clks, ARRAY_SIZE(hif_clks),
192 + mtk_clk_register_gates(&pdev->dev, node, hif_clks,
193 + ARRAY_SIZE(hif_clks), clk_data);
195 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
197 --- a/drivers/clk/mediatek/clk-mt2701-mm.c
198 +++ b/drivers/clk/mediatek/clk-mt2701-mm.c
199 @@ -76,8 +76,8 @@ static int clk_mt2701_mm_probe(struct pl
201 clk_data = mtk_alloc_clk_data(CLK_MM_NR);
203 - mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
205 + mtk_clk_register_gates(&pdev->dev, node, mm_clks,
206 + ARRAY_SIZE(mm_clks), clk_data);
208 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
210 --- a/drivers/clk/mediatek/clk-mt2701.c
211 +++ b/drivers/clk/mediatek/clk-mt2701.c
212 @@ -685,8 +685,8 @@ static int mtk_topckgen_init(struct plat
213 mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs),
214 base, &mt2701_clk_lock, clk_data);
216 - mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
218 + mtk_clk_register_gates(&pdev->dev, node, top_clks,
219 + ARRAY_SIZE(top_clks), clk_data);
221 return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
223 @@ -789,8 +789,8 @@ static int mtk_infrasys_init(struct plat
227 - mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
229 + mtk_clk_register_gates(&pdev->dev, node, infra_clks,
230 + ARRAY_SIZE(infra_clks), infra_clk_data);
231 mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs),
234 @@ -902,8 +902,8 @@ static int mtk_pericfg_init(struct platf
238 - mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
240 + mtk_clk_register_gates(&pdev->dev, node, peri_clks,
241 + ARRAY_SIZE(peri_clks), clk_data);
243 mtk_clk_register_composites(peri_muxs, ARRAY_SIZE(peri_muxs), base,
244 &mt2701_clk_lock, clk_data);
245 --- a/drivers/clk/mediatek/clk-mt2712-mm.c
246 +++ b/drivers/clk/mediatek/clk-mt2712-mm.c
247 @@ -117,8 +117,8 @@ static int clk_mt2712_mm_probe(struct pl
249 clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
251 - mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
253 + mtk_clk_register_gates(&pdev->dev, node, mm_clks,
254 + ARRAY_SIZE(mm_clks), clk_data);
256 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
258 --- a/drivers/clk/mediatek/clk-mt2712.c
259 +++ b/drivers/clk/mediatek/clk-mt2712.c
260 @@ -1324,8 +1324,8 @@ static int clk_mt2712_top_probe(struct p
261 &mt2712_clk_lock, top_clk_data);
262 mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), base,
263 &mt2712_clk_lock, top_clk_data);
264 - mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
266 + mtk_clk_register_gates(&pdev->dev, node, top_clks,
267 + ARRAY_SIZE(top_clks), top_clk_data);
269 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, top_clk_data);
271 @@ -1344,8 +1344,8 @@ static int clk_mt2712_infra_probe(struct
273 clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
275 - mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
277 + mtk_clk_register_gates(&pdev->dev, node, infra_clks,
278 + ARRAY_SIZE(infra_clks), clk_data);
280 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
282 @@ -1366,8 +1366,8 @@ static int clk_mt2712_peri_probe(struct
284 clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK);
286 - mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
288 + mtk_clk_register_gates(&pdev->dev, node, peri_clks,
289 + ARRAY_SIZE(peri_clks), clk_data);
291 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
293 --- a/drivers/clk/mediatek/clk-mt7622-aud.c
294 +++ b/drivers/clk/mediatek/clk-mt7622-aud.c
295 @@ -114,8 +114,8 @@ static int clk_mt7622_audiosys_init(stru
297 clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
299 - mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
301 + mtk_clk_register_gates(&pdev->dev, node, audio_clks,
302 + ARRAY_SIZE(audio_clks), clk_data);
304 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
306 --- a/drivers/clk/mediatek/clk-mt7622-eth.c
307 +++ b/drivers/clk/mediatek/clk-mt7622-eth.c
308 @@ -69,8 +69,8 @@ static int clk_mt7622_ethsys_init(struct
310 clk_data = mtk_alloc_clk_data(CLK_ETH_NR_CLK);
312 - mtk_clk_register_gates(node, eth_clks, ARRAY_SIZE(eth_clks),
314 + mtk_clk_register_gates(&pdev->dev, node, eth_clks,
315 + ARRAY_SIZE(eth_clks), clk_data);
317 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
319 @@ -91,8 +91,8 @@ static int clk_mt7622_sgmiisys_init(stru
321 clk_data = mtk_alloc_clk_data(CLK_SGMII_NR_CLK);
323 - mtk_clk_register_gates(node, sgmii_clks, ARRAY_SIZE(sgmii_clks),
325 + mtk_clk_register_gates(&pdev->dev, node, sgmii_clks,
326 + ARRAY_SIZE(sgmii_clks), clk_data);
328 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
330 --- a/drivers/clk/mediatek/clk-mt7622-hif.c
331 +++ b/drivers/clk/mediatek/clk-mt7622-hif.c
332 @@ -80,8 +80,8 @@ static int clk_mt7622_ssusbsys_init(stru
334 clk_data = mtk_alloc_clk_data(CLK_SSUSB_NR_CLK);
336 - mtk_clk_register_gates(node, ssusb_clks, ARRAY_SIZE(ssusb_clks),
338 + mtk_clk_register_gates(&pdev->dev, node, ssusb_clks,
339 + ARRAY_SIZE(ssusb_clks), clk_data);
341 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
343 @@ -102,8 +102,8 @@ static int clk_mt7622_pciesys_init(struc
345 clk_data = mtk_alloc_clk_data(CLK_PCIE_NR_CLK);
347 - mtk_clk_register_gates(node, pcie_clks, ARRAY_SIZE(pcie_clks),
349 + mtk_clk_register_gates(&pdev->dev, node, pcie_clks,
350 + ARRAY_SIZE(pcie_clks), clk_data);
352 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
354 --- a/drivers/clk/mediatek/clk-mt7622.c
355 +++ b/drivers/clk/mediatek/clk-mt7622.c
356 @@ -621,8 +621,8 @@ static int mtk_topckgen_init(struct plat
357 mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs),
358 base, &mt7622_clk_lock, clk_data);
360 - mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
362 + mtk_clk_register_gates(&pdev->dev, node, top_clks,
363 + ARRAY_SIZE(top_clks), clk_data);
365 return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
367 @@ -635,8 +635,8 @@ static int mtk_infrasys_init(struct plat
369 clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
371 - mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
373 + mtk_clk_register_gates(&pdev->dev, node, infra_clks,
374 + ARRAY_SIZE(infra_clks), clk_data);
376 mtk_clk_register_cpumuxes(node, infra_muxes, ARRAY_SIZE(infra_muxes),
378 @@ -663,7 +663,7 @@ static int mtk_apmixedsys_init(struct pl
379 mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls),
382 - mtk_clk_register_gates(node, apmixed_clks,
383 + mtk_clk_register_gates(&pdev->dev, node, apmixed_clks,
384 ARRAY_SIZE(apmixed_clks), clk_data);
386 return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
387 @@ -682,8 +682,8 @@ static int mtk_pericfg_init(struct platf
389 clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK);
391 - mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
393 + mtk_clk_register_gates(&pdev->dev, node, peri_clks,
394 + ARRAY_SIZE(peri_clks), clk_data);
396 mtk_clk_register_composites(peri_muxes, ARRAY_SIZE(peri_muxes), base,
397 &mt7622_clk_lock, clk_data);
398 --- a/drivers/clk/mediatek/clk-mt7629-eth.c
399 +++ b/drivers/clk/mediatek/clk-mt7629-eth.c
400 @@ -82,7 +82,8 @@ static int clk_mt7629_ethsys_init(struct
404 - mtk_clk_register_gates(node, eth_clks, CLK_ETH_NR_CLK, clk_data);
405 + mtk_clk_register_gates(&pdev->dev, node, eth_clks,
406 + CLK_ETH_NR_CLK, clk_data);
408 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
410 @@ -106,8 +107,8 @@ static int clk_mt7629_sgmiisys_init(stru
414 - mtk_clk_register_gates(node, sgmii_clks[id++], CLK_SGMII_NR_CLK,
416 + mtk_clk_register_gates(&pdev->dev, node, sgmii_clks[id++],
417 + CLK_SGMII_NR_CLK, clk_data);
419 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
421 --- a/drivers/clk/mediatek/clk-mt7629-hif.c
422 +++ b/drivers/clk/mediatek/clk-mt7629-hif.c
423 @@ -75,8 +75,8 @@ static int clk_mt7629_ssusbsys_init(stru
425 clk_data = mtk_alloc_clk_data(CLK_SSUSB_NR_CLK);
427 - mtk_clk_register_gates(node, ssusb_clks, ARRAY_SIZE(ssusb_clks),
429 + mtk_clk_register_gates(&pdev->dev, node, ssusb_clks,
430 + ARRAY_SIZE(ssusb_clks), clk_data);
432 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
434 @@ -97,8 +97,8 @@ static int clk_mt7629_pciesys_init(struc
436 clk_data = mtk_alloc_clk_data(CLK_PCIE_NR_CLK);
438 - mtk_clk_register_gates(node, pcie_clks, ARRAY_SIZE(pcie_clks),
440 + mtk_clk_register_gates(&pdev->dev, node, pcie_clks,
441 + ARRAY_SIZE(pcie_clks), clk_data);
443 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
445 --- a/drivers/clk/mediatek/clk-mt7629.c
446 +++ b/drivers/clk/mediatek/clk-mt7629.c
447 @@ -585,8 +585,8 @@ static int mtk_infrasys_init(struct plat
451 - mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
453 + mtk_clk_register_gates(&pdev->dev, node, infra_clks,
454 + ARRAY_SIZE(infra_clks), clk_data);
456 mtk_clk_register_cpumuxes(node, infra_muxes, ARRAY_SIZE(infra_muxes),
458 @@ -610,8 +610,8 @@ static int mtk_pericfg_init(struct platf
462 - mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
464 + mtk_clk_register_gates(&pdev->dev, node, peri_clks,
465 + ARRAY_SIZE(peri_clks), clk_data);
467 mtk_clk_register_composites(peri_muxes, ARRAY_SIZE(peri_muxes), base,
468 &mt7629_clk_lock, clk_data);
469 @@ -637,7 +637,7 @@ static int mtk_apmixedsys_init(struct pl
470 mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls),
473 - mtk_clk_register_gates(node, apmixed_clks,
474 + mtk_clk_register_gates(&pdev->dev, node, apmixed_clks,
475 ARRAY_SIZE(apmixed_clks), clk_data);
477 clk_prepare_enable(clk_data->hws[CLK_APMIXED_ARMPLL]->clk);
478 --- a/drivers/clk/mediatek/clk-mt7986-eth.c
479 +++ b/drivers/clk/mediatek/clk-mt7986-eth.c
480 @@ -72,8 +72,8 @@ static void __init mtk_sgmiisys_0_init(s
482 clk_data = mtk_alloc_clk_data(ARRAY_SIZE(sgmii0_clks));
484 - mtk_clk_register_gates(node, sgmii0_clks, ARRAY_SIZE(sgmii0_clks),
486 + mtk_clk_register_gates(NULL, node, sgmii0_clks,
487 + ARRAY_SIZE(sgmii0_clks), clk_data);
489 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
491 @@ -90,8 +90,8 @@ static void __init mtk_sgmiisys_1_init(s
493 clk_data = mtk_alloc_clk_data(ARRAY_SIZE(sgmii1_clks));
495 - mtk_clk_register_gates(node, sgmii1_clks, ARRAY_SIZE(sgmii1_clks),
497 + mtk_clk_register_gates(NULL, node, sgmii1_clks,
498 + ARRAY_SIZE(sgmii1_clks), clk_data);
500 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
502 @@ -109,7 +109,7 @@ static void __init mtk_ethsys_init(struc
504 clk_data = mtk_alloc_clk_data(ARRAY_SIZE(eth_clks));
506 - mtk_clk_register_gates(node, eth_clks, ARRAY_SIZE(eth_clks), clk_data);
507 + mtk_clk_register_gates(NULL, node, eth_clks, ARRAY_SIZE(eth_clks), clk_data);
509 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
511 --- a/drivers/clk/mediatek/clk-mt7986-infracfg.c
512 +++ b/drivers/clk/mediatek/clk-mt7986-infracfg.c
513 @@ -180,8 +180,8 @@ static int clk_mt7986_infracfg_probe(str
514 mtk_clk_register_factors(infra_divs, ARRAY_SIZE(infra_divs), clk_data);
515 mtk_clk_register_muxes(infra_muxes, ARRAY_SIZE(infra_muxes), node,
516 &mt7986_clk_lock, clk_data);
517 - mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
519 + mtk_clk_register_gates(&pdev->dev, node, infra_clks,
520 + ARRAY_SIZE(infra_clks), clk_data);
522 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
524 --- a/drivers/clk/mediatek/clk-mtk.c
525 +++ b/drivers/clk/mediatek/clk-mtk.c
526 @@ -459,8 +459,8 @@ int mtk_clk_simple_probe(struct platform
530 - r = mtk_clk_register_gates_with_dev(node, mcd->clks, mcd->num_clks,
531 - clk_data, &pdev->dev);
532 + r = mtk_clk_register_gates(&pdev->dev, node, mcd->clks, mcd->num_clks,