clk: mediatek: Replace 'struct clk' with 'struct clk_hw'
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 19 May 2022 07:16:08 +0000 (15:16 +0800)
committerStephen Boyd <sboyd@kernel.org>
Thu, 19 May 2022 23:57:56 +0000 (16:57 -0700)
As part of the effort to improve the MediaTek clk drivers, the next step
is to switch from the old 'struct clk' clk prodivder APIs to the new
'struct clk_hw' ones.

Instead of adding new APIs to the MediaTek clk driver library mirroring
the existing ones, moving all drivers to the new APIs, and then removing
the old ones, just migrate everything at the same time. This involves
replacing 'struct clk' with 'struct clk_hw', and 'struct clk_onecell_data'
with 'struct clk_hw_onecell_data', and fixing up all usages.

For now, the clk_register() and co. usage is retained, with __clk_get_hw()
and (struct clk_hw *)->clk used to bridge the difference between the APIs.
These will be replaced in subsequent patches.

Fix up mtk_{alloc,free}_clk_data to use 'struct clk_hw' by hand. Fix up
all other affected call sites with the following coccinelle script.

    // Replace type
    @@
    @@
    - struct clk_onecell_data
    + struct clk_hw_onecell_data

    // Replace of_clk_add_provider() & of_clk_src_simple_get()
    @@
    expression NP, DATA;
    symbol of_clk_src_onecell_get;
    @@
    - of_clk_add_provider(
    + of_clk_add_hw_provider(
    NP,
    - of_clk_src_onecell_get,
    + of_clk_hw_onecell_get,
    DATA
      )

    // Fix register/unregister
    @@
    identifier CD;
    expression E;
    identifier fn =~ "unregister";
    @@
      fn(...,
    -    CD->clks[E]
    +    CD->hws[E]->clk
 ,...
);

    // Fix calls to clk_prepare_enable()
    @@
    identifier CD;
    expression E;
    @@
      clk_prepare_enable(
    -       CD->clks[E]
    +       CD->hws[E]->clk
      );

    // Fix pointer assignment
    @@
    identifier CD;
    identifier CLK;
    expression E;
    @@
    - CD->clks[E]
    + CD->hws[E]
      =
    (
    - CLK
    + __clk_get_hw(CLK)
    |
      ERR_PTR(...)
    )
      ;

    // Fix pointer usage
    @@
    identifier CD;
    expression E;
    @@
    - CD->clks[E]
    + CD->hws[E]

    // Fix mtk_clk_pll_get_base()
    @@
    symbol clk, hw, data;
    @@
      mtk_clk_pll_get_base(
    -         struct clk *clk,
    +         struct clk_hw *hw,
   const struct mtk_pll_data *data
      ) {
    - struct clk_hw *hw = __clk_get_hw(clk);
      ...
      }

    // Fix mtk_clk_pll_get_base() usage
    @@
    identifier CD;
    expression E;
    @@
      mtk_clk_pll_get_base(
    -    CD->clks[E]
    +    CD->hws[E]->clk
 ,...
      );

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20220519071610.423372-4-wenst@chromium.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
94 files changed:
drivers/clk/mediatek/clk-cpumux.c
drivers/clk/mediatek/clk-cpumux.h
drivers/clk/mediatek/clk-gate.c
drivers/clk/mediatek/clk-gate.h
drivers/clk/mediatek/clk-mt2701-aud.c
drivers/clk/mediatek/clk-mt2701-bdp.c
drivers/clk/mediatek/clk-mt2701-eth.c
drivers/clk/mediatek/clk-mt2701-g3d.c
drivers/clk/mediatek/clk-mt2701-hif.c
drivers/clk/mediatek/clk-mt2701-img.c
drivers/clk/mediatek/clk-mt2701-mm.c
drivers/clk/mediatek/clk-mt2701-vdec.c
drivers/clk/mediatek/clk-mt2701.c
drivers/clk/mediatek/clk-mt2712-bdp.c
drivers/clk/mediatek/clk-mt2712-img.c
drivers/clk/mediatek/clk-mt2712-jpgdec.c
drivers/clk/mediatek/clk-mt2712-mfg.c
drivers/clk/mediatek/clk-mt2712-mm.c
drivers/clk/mediatek/clk-mt2712-vdec.c
drivers/clk/mediatek/clk-mt2712-venc.c
drivers/clk/mediatek/clk-mt2712.c
drivers/clk/mediatek/clk-mt6765-audio.c
drivers/clk/mediatek/clk-mt6765-cam.c
drivers/clk/mediatek/clk-mt6765-img.c
drivers/clk/mediatek/clk-mt6765-mipi0a.c
drivers/clk/mediatek/clk-mt6765-mm.c
drivers/clk/mediatek/clk-mt6765-vcodec.c
drivers/clk/mediatek/clk-mt6765.c
drivers/clk/mediatek/clk-mt6779-aud.c
drivers/clk/mediatek/clk-mt6779-cam.c
drivers/clk/mediatek/clk-mt6779-img.c
drivers/clk/mediatek/clk-mt6779-ipe.c
drivers/clk/mediatek/clk-mt6779-mfg.c
drivers/clk/mediatek/clk-mt6779-mm.c
drivers/clk/mediatek/clk-mt6779-vdec.c
drivers/clk/mediatek/clk-mt6779-venc.c
drivers/clk/mediatek/clk-mt6779.c
drivers/clk/mediatek/clk-mt6797-img.c
drivers/clk/mediatek/clk-mt6797-mm.c
drivers/clk/mediatek/clk-mt6797-vdec.c
drivers/clk/mediatek/clk-mt6797-venc.c
drivers/clk/mediatek/clk-mt6797.c
drivers/clk/mediatek/clk-mt7622-aud.c
drivers/clk/mediatek/clk-mt7622-eth.c
drivers/clk/mediatek/clk-mt7622-hif.c
drivers/clk/mediatek/clk-mt7622.c
drivers/clk/mediatek/clk-mt7629-eth.c
drivers/clk/mediatek/clk-mt7629-hif.c
drivers/clk/mediatek/clk-mt7629.c
drivers/clk/mediatek/clk-mt7986-apmixed.c
drivers/clk/mediatek/clk-mt7986-eth.c
drivers/clk/mediatek/clk-mt7986-infracfg.c
drivers/clk/mediatek/clk-mt7986-topckgen.c
drivers/clk/mediatek/clk-mt8135.c
drivers/clk/mediatek/clk-mt8167-aud.c
drivers/clk/mediatek/clk-mt8167-img.c
drivers/clk/mediatek/clk-mt8167-mfgcfg.c
drivers/clk/mediatek/clk-mt8167-mm.c
drivers/clk/mediatek/clk-mt8167-vdec.c
drivers/clk/mediatek/clk-mt8167.c
drivers/clk/mediatek/clk-mt8173-mm.c
drivers/clk/mediatek/clk-mt8173.c
drivers/clk/mediatek/clk-mt8183-audio.c
drivers/clk/mediatek/clk-mt8183-cam.c
drivers/clk/mediatek/clk-mt8183-img.c
drivers/clk/mediatek/clk-mt8183-ipu0.c
drivers/clk/mediatek/clk-mt8183-ipu1.c
drivers/clk/mediatek/clk-mt8183-ipu_adl.c
drivers/clk/mediatek/clk-mt8183-ipu_conn.c
drivers/clk/mediatek/clk-mt8183-mfgcfg.c
drivers/clk/mediatek/clk-mt8183-mm.c
drivers/clk/mediatek/clk-mt8183-vdec.c
drivers/clk/mediatek/clk-mt8183-venc.c
drivers/clk/mediatek/clk-mt8183.c
drivers/clk/mediatek/clk-mt8186-apmixedsys.c
drivers/clk/mediatek/clk-mt8186-mcu.c
drivers/clk/mediatek/clk-mt8186-mm.c
drivers/clk/mediatek/clk-mt8186-topckgen.c
drivers/clk/mediatek/clk-mt8192-aud.c
drivers/clk/mediatek/clk-mt8192-mm.c
drivers/clk/mediatek/clk-mt8192.c
drivers/clk/mediatek/clk-mt8195-apmixedsys.c
drivers/clk/mediatek/clk-mt8195-apusys_pll.c
drivers/clk/mediatek/clk-mt8195-topckgen.c
drivers/clk/mediatek/clk-mt8195-vdo0.c
drivers/clk/mediatek/clk-mt8195-vdo1.c
drivers/clk/mediatek/clk-mt8516-aud.c
drivers/clk/mediatek/clk-mt8516.c
drivers/clk/mediatek/clk-mtk.c
drivers/clk/mediatek/clk-mtk.h
drivers/clk/mediatek/clk-mux.c
drivers/clk/mediatek/clk-mux.h
drivers/clk/mediatek/clk-pll.c
drivers/clk/mediatek/clk-pll.h

index c11b3fae622e40b54d52fc493ccbc38e3baf3654..8e80df43e356cefc50063004af7f6eadbc1c2f71 100644 (file)
@@ -105,7 +105,7 @@ static void mtk_clk_unregister_cpumux(struct clk *clk)
 
 int mtk_clk_register_cpumuxes(struct device_node *node,
                              const struct mtk_composite *clks, int num,
-                             struct clk_onecell_data *clk_data)
+                             struct clk_hw_onecell_data *clk_data)
 {
        int i;
        struct clk *clk;
@@ -120,7 +120,7 @@ int mtk_clk_register_cpumuxes(struct device_node *node,
        for (i = 0; i < num; i++) {
                const struct mtk_composite *mux = &clks[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[mux->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[mux->id])) {
                        pr_warn("%pOF: Trying to register duplicate clock ID: %d\n",
                                node, mux->id);
                        continue;
@@ -132,7 +132,7 @@ int mtk_clk_register_cpumuxes(struct device_node *node,
                        goto err;
                }
 
-               clk_data->clks[mux->id] = clk;
+               clk_data->hws[mux->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -141,29 +141,29 @@ err:
        while (--i >= 0) {
                const struct mtk_composite *mux = &clks[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mux->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
                        continue;
 
-               mtk_clk_unregister_cpumux(clk_data->clks[mux->id]);
-               clk_data->clks[mux->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_cpumux(clk_data->hws[mux->id]->clk);
+               clk_data->hws[mux->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
 }
 
 void mtk_clk_unregister_cpumuxes(const struct mtk_composite *clks, int num,
-                                struct clk_onecell_data *clk_data)
+                                struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
        for (i = num; i > 0; i--) {
                const struct mtk_composite *mux = &clks[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mux->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
                        continue;
 
-               mtk_clk_unregister_cpumux(clk_data->clks[mux->id]);
-               clk_data->clks[mux->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_cpumux(clk_data->hws[mux->id]->clk);
+               clk_data->hws[mux->id] = ERR_PTR(-ENOENT);
        }
 }
 
index b07e89f7c2832de5610c91795527bc4f3cb24ebf..325adbef25d13a1c2f5c2f9ad5de0ca87f64d8e4 100644 (file)
@@ -7,15 +7,15 @@
 #ifndef __DRV_CLK_CPUMUX_H
 #define __DRV_CLK_CPUMUX_H
 
-struct clk_onecell_data;
+struct clk_hw_onecell_data;
 struct device_node;
 struct mtk_composite;
 
 int mtk_clk_register_cpumuxes(struct device_node *node,
                              const struct mtk_composite *clks, int num,
-                             struct clk_onecell_data *clk_data);
+                             struct clk_hw_onecell_data *clk_data);
 
 void mtk_clk_unregister_cpumuxes(const struct mtk_composite *clks, int num,
-                                struct clk_onecell_data *clk_data);
+                                struct clk_hw_onecell_data *clk_data);
 
 #endif /* __DRV_CLK_CPUMUX_H */
index da52023f845588b1a9a4b252664a616498dfde1e..0955cace5b1b0024300941df58f3a45bbaac145f 100644 (file)
@@ -205,7 +205,7 @@ static void mtk_clk_unregister_gate(struct clk *clk)
 
 int mtk_clk_register_gates_with_dev(struct device_node *node,
                                    const struct mtk_gate *clks, int num,
-                                   struct clk_onecell_data *clk_data,
+                                   struct clk_hw_onecell_data *clk_data,
                                    struct device *dev)
 {
        int i;
@@ -224,7 +224,7 @@ int mtk_clk_register_gates_with_dev(struct device_node *node,
        for (i = 0; i < num; i++) {
                const struct mtk_gate *gate = &clks[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[gate->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[gate->id])) {
                        pr_warn("%pOF: Trying to register duplicate clock ID: %d\n",
                                node, gate->id);
                        continue;
@@ -243,7 +243,7 @@ int mtk_clk_register_gates_with_dev(struct device_node *node,
                        goto err;
                }
 
-               clk_data->clks[gate->id] = clk;
+               clk_data->hws[gate->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -252,11 +252,11 @@ err:
        while (--i >= 0) {
                const struct mtk_gate *gate = &clks[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[gate->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[gate->id]))
                        continue;
 
-               mtk_clk_unregister_gate(clk_data->clks[gate->id]);
-               clk_data->clks[gate->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_gate(clk_data->hws[gate->id]->clk);
+               clk_data->hws[gate->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
@@ -264,14 +264,14 @@ err:
 
 int mtk_clk_register_gates(struct device_node *node,
                           const struct mtk_gate *clks, int num,
-                          struct clk_onecell_data *clk_data)
+                          struct clk_hw_onecell_data *clk_data)
 {
        return mtk_clk_register_gates_with_dev(node, clks, num, clk_data, NULL);
 }
 EXPORT_SYMBOL_GPL(mtk_clk_register_gates);
 
 void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
-                             struct clk_onecell_data *clk_data)
+                             struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
@@ -281,11 +281,11 @@ void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
        for (i = num; i > 0; i--) {
                const struct mtk_gate *gate = &clks[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[gate->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[gate->id]))
                        continue;
 
-               mtk_clk_unregister_gate(clk_data->clks[gate->id]);
-               clk_data->clks[gate->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_gate(clk_data->hws[gate->id]->clk);
+               clk_data->hws[gate->id] = ERR_PTR(-ENOENT);
        }
 }
 EXPORT_SYMBOL_GPL(mtk_clk_unregister_gates);
index 6b5738826a223ac646bf9589bc6c0720f2367182..d9897ef5352844badc0b8107693aa6751b292ef1 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 
 struct clk;
-struct clk_onecell_data;
+struct clk_hw_onecell_data;
 struct clk_ops;
 struct device;
 struct device_node;
@@ -52,14 +52,14 @@ struct mtk_gate {
 
 int mtk_clk_register_gates(struct device_node *node,
                           const struct mtk_gate *clks, int num,
-                          struct clk_onecell_data *clk_data);
+                          struct clk_hw_onecell_data *clk_data);
 
 int mtk_clk_register_gates_with_dev(struct device_node *node,
                                    const struct mtk_gate *clks, int num,
-                                   struct clk_onecell_data *clk_data,
+                                   struct clk_hw_onecell_data *clk_data,
                                    struct device *dev);
 
 void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
-                             struct clk_onecell_data *clk_data);
+                             struct clk_hw_onecell_data *clk_data);
 
 #endif /* __DRV_CLK_GATE_H */
index e66896a44fad8854243cccd5c9ada89911aa0edb..6ba398eb7df9158339402553585cae6d9e2a66a4 100644 (file)
@@ -145,7 +145,7 @@ static const struct of_device_id of_match_clk_mt2701_aud[] = {
 
 static int clk_mt2701_aud_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -154,7 +154,7 @@ static int clk_mt2701_aud_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r) {
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index ffa09cfbfd51a0eee611ad95742ba9e4097bb492..662a8ab3fbb18a828048edf3241a12cb90d4df58 100644 (file)
@@ -101,7 +101,7 @@ static const struct of_device_id of_match_clk_mt2701_bdp[] = {
 
 static int clk_mt2701_bdp_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -110,7 +110,7 @@ static int clk_mt2701_bdp_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, bdp_clks, ARRAY_SIZE(bdp_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 100ff6ca609e86c0d239178be136f68a7997b024..47c2289f3d1df9e438f0a014fb4251bba637209b 100644 (file)
@@ -43,7 +43,7 @@ static const struct of_device_id of_match_clk_mt2701_eth[] = {
 
 static int clk_mt2701_eth_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -52,7 +52,7 @@ static int clk_mt2701_eth_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, eth_clks, ARRAY_SIZE(eth_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 1328c112a38fed702d3a1526155a1bc2643b9bb8..79929ed37f83830531a8d7602ab3747f9b679c77 100644 (file)
@@ -37,7 +37,7 @@ static const struct mtk_gate g3d_clks[] = {
 
 static int clk_mt2701_g3dsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -46,7 +46,7 @@ static int clk_mt2701_g3dsys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, g3d_clks, ARRAY_SIZE(g3d_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 61444881c53910692ed1782c698acd292b8537ce..1aa36cb93ad0ab210d5aa4cd82beef5dfc3d64cb 100644 (file)
@@ -40,7 +40,7 @@ static const struct of_device_id of_match_clk_mt2701_hif[] = {
 
 static int clk_mt2701_hif_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -49,7 +49,7 @@ static int clk_mt2701_hif_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, hif_clks, ARRAY_SIZE(hif_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r) {
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 631e80f0fc7df439f92d4fa2267a5748cebae42b..c4f3cd26df60b51b2fd744fb5a7fa261fb750f55 100644 (file)
@@ -43,7 +43,7 @@ static const struct of_device_id of_match_clk_mt2701_img[] = {
 
 static int clk_mt2701_img_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -52,7 +52,7 @@ static int clk_mt2701_img_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index cb18e1849492cc612f951978f22dce7ca6a90cbf..9ea7abad99d23a8bca69ec7910a2274a84f0663d 100644 (file)
@@ -83,7 +83,7 @@ static int clk_mt2701_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR);
@@ -91,7 +91,7 @@ static int clk_mt2701_mm_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index c9def728ad1e828499ae42bc6868e187dc907b81..a2f18117f27a602ef312e723799a9edb8d32ddb6 100644 (file)
@@ -54,7 +54,7 @@ static const struct of_device_id of_match_clk_mt2701_vdec[] = {
 
 static int clk_mt2701_vdec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -63,7 +63,7 @@ static int clk_mt2701_vdec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index ba7bda16d193ff2581c60c8f9d928a7c54d66a55..04ba356db2d7eb62ecbc0962eec419759765dd61 100644 (file)
@@ -666,7 +666,7 @@ static const struct mtk_gate top_clks[] = {
 
 static int mtk_topckgen_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        struct device_node *node = pdev->dev.of_node;
        struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -692,7 +692,7 @@ static int mtk_topckgen_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
                                                clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct mtk_gate_regs infra_cg_regs = {
@@ -735,7 +735,7 @@ static const struct mtk_fixed_factor infra_fixed_divs[] = {
        FACTOR(CLK_INFRA_CLK_13M, "clk13m", "clk26m", 1, 2),
 };
 
-static struct clk_onecell_data *infra_clk_data;
+static struct clk_hw_onecell_data *infra_clk_data;
 
 static void __init mtk_infrasys_init_early(struct device_node *node)
 {
@@ -745,7 +745,7 @@ static void __init mtk_infrasys_init_early(struct device_node *node)
                infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
 
                for (i = 0; i < CLK_INFRA_NR; i++)
-                       infra_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
+                       infra_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
        }
 
        mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs),
@@ -754,7 +754,8 @@ static void __init mtk_infrasys_init_early(struct device_node *node)
        mtk_clk_register_cpumuxes(node, cpu_muxes, ARRAY_SIZE(cpu_muxes),
                                  infra_clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                  infra_clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -771,8 +772,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
                infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
        } else {
                for (i = 0; i < CLK_INFRA_NR; i++) {
-                       if (infra_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
-                               infra_clk_data->clks[i] = ERR_PTR(-ENOENT);
+                       if (infra_clk_data->hws[i] == ERR_PTR(-EPROBE_DEFER))
+                               infra_clk_data->hws[i] = ERR_PTR(-ENOENT);
                }
        }
 
@@ -781,7 +782,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
        mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs),
                                                infra_clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                  infra_clk_data);
        if (r)
                return r;
 
@@ -886,7 +888,7 @@ static const struct mtk_composite peri_muxs[] = {
 
 static int mtk_pericfg_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
        struct device_node *node = pdev->dev.of_node;
@@ -904,7 +906,7 @@ static int mtk_pericfg_init(struct platform_device *pdev)
        mtk_clk_register_composites(peri_muxs, ARRAY_SIZE(peri_muxs), base,
                        &mt2701_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                return r;
 
@@ -969,7 +971,7 @@ static const struct mtk_fixed_factor apmixed_fixed_divs[] = {
 
 static int mtk_apmixedsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR);
@@ -981,7 +983,7 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
        mtk_clk_register_factors(apmixed_fixed_divs, ARRAY_SIZE(apmixed_fixed_divs),
                                                                clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt2701[] = {
index a200714001d825d7dbd487a0b18fad7301787c67..9acab43571337c9d39e3e22943a3d36ae042499d 100644 (file)
@@ -60,7 +60,7 @@ static const struct mtk_gate bdp_clks[] = {
 
 static int clk_mt2712_bdp_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -69,7 +69,7 @@ static int clk_mt2712_bdp_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, bdp_clks, ARRAY_SIZE(bdp_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 89b2a7197b020eeba1ea332dc5bbed5462149579..5cc143e65e423dfab458fb02146e9f3e0ceb36cf 100644 (file)
@@ -38,7 +38,7 @@ static const struct mtk_gate img_clks[] = {
 
 static int clk_mt2712_img_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -47,7 +47,7 @@ static int clk_mt2712_img_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 58813c38ab4d173115362daaa0465f8eaa274155..31fc30370d9831c1e6fd6744a3adeb6a9e1bf573 100644 (file)
@@ -34,7 +34,7 @@ static const struct mtk_gate jpgdec_clks[] = {
 
 static int clk_mt2712_jpgdec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -43,7 +43,7 @@ static int clk_mt2712_jpgdec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, jpgdec_clks, ARRAY_SIZE(jpgdec_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index a6b827db17bc9041f6561d9fb68d76e9f3edfab9..a4d09675bf18e0d80d8dd067603421e414a5cdd6 100644 (file)
@@ -33,7 +33,7 @@ static const struct mtk_gate mfg_clks[] = {
 
 static int clk_mt2712_mfg_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -42,7 +42,7 @@ static int clk_mt2712_mfg_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, mfg_clks, ARRAY_SIZE(mfg_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 5519c3d68c1f5e2c4f6fb09ad529d4788e6e41f3..7d44b09b8a0a793abe14818e52647ba16d0c8239 100644 (file)
@@ -130,7 +130,7 @@ static int clk_mt2712_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
@@ -138,7 +138,7 @@ static int clk_mt2712_mm_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 4987ad9d3b1161b8b72a3676534b17670bf5f25a..af13f43dd83198b6c54878db5894f88d678c4030 100644 (file)
@@ -52,7 +52,7 @@ static const struct mtk_gate vdec_clks[] = {
 
 static int clk_mt2712_vdec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -61,7 +61,7 @@ static int clk_mt2712_vdec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 07c29daa1ad6e139771fc5faa32e8a5badb3284e..abc08a02975353c83640cf35bf3b3c5deed3a281 100644 (file)
@@ -35,7 +35,7 @@ static const struct mtk_gate venc_clks[] = {
 
 static int clk_mt2712_venc_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -44,7 +44,7 @@ static int clk_mt2712_venc_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, venc_clks, ARRAY_SIZE(venc_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 7a65c781552f29f9aa03729d71c657920d406049..410b059727ea1e683b63d81a3955b9bfef8cedc9 100644 (file)
@@ -1260,7 +1260,7 @@ static const struct mtk_pll_data plls[] = {
 
 static int clk_mt2712_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -1268,7 +1268,7 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev)
 
        mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -1277,7 +1277,7 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev)
        return r;
 }
 
-static struct clk_onecell_data *top_clk_data;
+static struct clk_hw_onecell_data *top_clk_data;
 
 static void clk_mt2712_top_init_early(struct device_node *node)
 {
@@ -1287,13 +1287,13 @@ static void clk_mt2712_top_init_early(struct device_node *node)
                top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 
                for (i = 0; i < CLK_TOP_NR_CLK; i++)
-                       top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
+                       top_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
        }
 
        mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs),
                        top_clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, top_clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -1318,8 +1318,8 @@ static int clk_mt2712_top_probe(struct platform_device *pdev)
                top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
        } else {
                for (i = 0; i < CLK_TOP_NR_CLK; i++) {
-                       if (top_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
-                               top_clk_data->clks[i] = ERR_PTR(-ENOENT);
+                       if (top_clk_data->hws[i] == ERR_PTR(-EPROBE_DEFER))
+                               top_clk_data->hws[i] = ERR_PTR(-ENOENT);
                }
        }
 
@@ -1335,7 +1335,7 @@ static int clk_mt2712_top_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
                        top_clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, top_clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -1346,7 +1346,7 @@ static int clk_mt2712_top_probe(struct platform_device *pdev)
 
 static int clk_mt2712_infra_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -1355,7 +1355,7 @@ static int clk_mt2712_infra_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -1368,7 +1368,7 @@ static int clk_mt2712_infra_probe(struct platform_device *pdev)
 
 static int clk_mt2712_peri_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -1377,7 +1377,7 @@ static int clk_mt2712_peri_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -1390,7 +1390,7 @@ static int clk_mt2712_peri_probe(struct platform_device *pdev)
 
 static int clk_mt2712_mcu_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
        void __iomem *base;
@@ -1406,7 +1406,7 @@ static int clk_mt2712_mcu_probe(struct platform_device *pdev)
        mtk_clk_register_composites(mcu_muxes, ARRAY_SIZE(mcu_muxes), base,
                        &mt2712_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r != 0)
                pr_err("%s(): could not register clock provider: %d\n",
index 4c989165d795059968e07e2c7320857240d4abff..9c6e9caad5972e04e623868b9e84fe2118a0cd81 100644 (file)
@@ -66,7 +66,7 @@ static const struct mtk_gate audio_clks[] = {
 
 static int clk_mt6765_audio_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -75,7 +75,7 @@ static int clk_mt6765_audio_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, audio_clks,
                               ARRAY_SIZE(audio_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index c96394893bcfda6b1ae6a238c46f184433da4418..2586d3ac4cd45fd7d3210ab0d48262084b16f0a9 100644 (file)
@@ -41,7 +41,7 @@ static const struct mtk_gate cam_clks[] = {
 
 static int clk_mt6765_cam_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -49,7 +49,7 @@ static int clk_mt6765_cam_probe(struct platform_device *pdev)
 
        mtk_clk_register_gates(node, cam_clks, ARRAY_SIZE(cam_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 6fd8bf8030fc703e6415d0e67863474f4d0dbb66..8cc95b98921e1909121833f757c0ebca9b790aca 100644 (file)
@@ -37,7 +37,7 @@ static const struct mtk_gate img_clks[] = {
 
 static int clk_mt6765_img_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -45,7 +45,7 @@ static int clk_mt6765_img_probe(struct platform_device *pdev)
 
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 81744d0f95a0f555017f884c206c2be10b21fd0c..c816e26a95f99de84e0d2449323291f584285042 100644 (file)
@@ -34,7 +34,7 @@ static const struct mtk_gate mipi0a_clks[] = {
 
 static int clk_mt6765_mipi0a_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -43,7 +43,7 @@ static int clk_mt6765_mipi0a_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, mipi0a_clks,
                               ARRAY_SIZE(mipi0a_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 6d8214c51684e62e7de4e203ec6772b4abead7fb..ee6d3b859a6ca4a04a6bf8ffd96b6761ab3d7c4c 100644 (file)
@@ -63,7 +63,7 @@ static const struct mtk_gate mm_clks[] = {
 
 static int clk_mt6765_mm_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -71,7 +71,7 @@ static int clk_mt6765_mm_probe(struct platform_device *pdev)
 
        mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index baae665fab31cfcf94f732ca3b85c8a738acb454..d8045979d48a5fb11538b771a001725c6de0f34d 100644 (file)
@@ -36,7 +36,7 @@ static const struct mtk_gate venc_clks[] = {
 
 static int clk_mt6765_vcodec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -45,7 +45,7 @@ static int clk_mt6765_vcodec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, venc_clks,
                               ARRAY_SIZE(venc_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 46538d30da76a3135513efcb225359f0abc420ea..e9b9e6729733528be28d00af281d1e4b897dbee6 100644 (file)
@@ -773,7 +773,7 @@ static const struct mtk_pll_data plls[] = {
 
 static int clk_mt6765_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
        void __iomem *base;
@@ -791,7 +791,7 @@ static int clk_mt6765_apmixed_probe(struct platform_device *pdev)
 
        mtk_clk_register_gates(node, apmixed_clks,
                               ARRAY_SIZE(apmixed_clks), clk_data);
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -811,7 +811,7 @@ static int clk_mt6765_top_probe(struct platform_device *pdev)
        int r;
        struct device_node *node = pdev->dev.of_node;
        void __iomem *base;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
        base = devm_ioremap_resource(&pdev->dev, res);
@@ -831,7 +831,7 @@ static int clk_mt6765_top_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -848,7 +848,7 @@ static int clk_mt6765_top_probe(struct platform_device *pdev)
 
 static int clk_mt6765_ifr_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
        void __iomem *base;
@@ -864,7 +864,7 @@ static int clk_mt6765_ifr_probe(struct platform_device *pdev)
 
        mtk_clk_register_gates(node, ifr_clks, ARRAY_SIZE(ifr_clks),
                               clk_data);
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 9e889e4c361a6d46f5af47ea6bbf83c9b14c2223..97e44abb7e8798d42e6b912430f2093fcd7cde99 100644 (file)
@@ -96,7 +96,7 @@ static const struct of_device_id of_match_clk_mt6779_aud[] = {
 
 static int clk_mt6779_aud_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_AUD_NR_CLK);
@@ -104,7 +104,7 @@ static int clk_mt6779_aud_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_aud_drv = {
index 7f07a2a139acf4b1abac0a0e7467d35aa0b9fb81..9c5117aae14689ca01acdc1a477bbc24bd97ec79 100644 (file)
@@ -45,7 +45,7 @@ static const struct of_device_id of_match_clk_mt6779_cam[] = {
 
 static int clk_mt6779_cam_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_CAM_NR_CLK);
@@ -53,7 +53,7 @@ static int clk_mt6779_cam_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, cam_clks, ARRAY_SIZE(cam_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_cam_drv = {
index f0961fa1a28649d7c53c71ffe1214cd3564cc1f8..801271477d46ba2364cee4e2487e5dd425a2558f 100644 (file)
@@ -37,7 +37,7 @@ static const struct of_device_id of_match_clk_mt6779_img[] = {
 
 static int clk_mt6779_img_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IMG_NR_CLK);
@@ -45,7 +45,7 @@ static int clk_mt6779_img_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_img_drv = {
index 8c6f3e154bf35506b7826df1ea2626179534f62f..f67814ca7dfba7abdf6f76e65562592043645f75 100644 (file)
@@ -39,7 +39,7 @@ static const struct of_device_id of_match_clk_mt6779_ipe[] = {
 
 static int clk_mt6779_ipe_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IPE_NR_CLK);
@@ -47,7 +47,7 @@ static int clk_mt6779_ipe_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, ipe_clks, ARRAY_SIZE(ipe_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_ipe_drv = {
index 9f3372886e6b41921c6e0f0399b7d6d736d935cd..fc7387b59758d36220c11f24ab7eea41b3abdb16 100644 (file)
@@ -29,7 +29,7 @@ static const struct mtk_gate mfg_clks[] = {
 
 static int clk_mt6779_mfg_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_MFGCFG_NR_CLK);
@@ -37,7 +37,7 @@ static int clk_mt6779_mfg_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, mfg_clks, ARRAY_SIZE(mfg_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt6779_mfg[] = {
index 33946e6471227e881f30cf746e31feb4948d3395..eda8cbee3d234203fedeb7438c7aa45601184d67 100644 (file)
@@ -89,14 +89,14 @@ static int clk_mt6779_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
 
        mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_mm_drv = {
index f4358844c2e08659440c483203566bb0c18ec3e5..7e195b082e86754420e59da6492e7baed6ec0fb6 100644 (file)
@@ -46,7 +46,7 @@ static const struct of_device_id of_match_clk_mt6779_vdec[] = {
 
 static int clk_mt6779_vdec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_VDEC_GCON_NR_CLK);
@@ -54,7 +54,7 @@ static int clk_mt6779_vdec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_vdec_drv = {
index ff67084af5aa11393dafcef50ddce90d3b875c02..573efa87c9bdc0d79a0f61f33406e2f393642439 100644 (file)
@@ -37,7 +37,7 @@ static const struct of_device_id of_match_clk_mt6779_venc[] = {
 
 static int clk_mt6779_venc_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_VENC_GCON_NR_CLK);
@@ -45,7 +45,7 @@ static int clk_mt6779_venc_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, venc_clks, ARRAY_SIZE(venc_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt6779_venc_drv = {
index eac45c2e84622181e7c7bc12a60f85547baa1950..0d0a90ee5eb2c1a0a0bae7333382049511921338 100644 (file)
@@ -1214,7 +1214,7 @@ static const struct mtk_pll_data plls[] = {
 
 static int clk_mt6779_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
@@ -1224,13 +1224,13 @@ static int clk_mt6779_apmixed_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, apmixed_clks,
                               ARRAY_SIZE(apmixed_clks), clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static int clk_mt6779_top_probe(struct platform_device *pdev)
 {
        void __iomem *base;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        base = devm_platform_ioremap_resource(pdev, 0);
@@ -1253,12 +1253,12 @@ static int clk_mt6779_top_probe(struct platform_device *pdev)
        mtk_clk_register_composites(top_aud_divs, ARRAY_SIZE(top_aud_divs),
                                    base, &mt6779_clk_lock, clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static int clk_mt6779_infra_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
@@ -1266,7 +1266,7 @@ static int clk_mt6779_infra_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt6779[] = {
index 908bf9784f0335122e1235b806146b43f23761ee..25d17db13bac3ca4674617a4a77aa0ab6e6c2cfe 100644 (file)
@@ -39,7 +39,7 @@ static const struct of_device_id of_match_clk_mt6797_img[] = {
 
 static int clk_mt6797_img_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -48,7 +48,7 @@ static int clk_mt6797_img_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 01fdce2872477eb73564dba254b9e0f72b450422..0846011fc8943ec00c27fb334ddf7ce08bd32606 100644 (file)
@@ -96,7 +96,7 @@ static int clk_mt6797_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR);
@@ -104,7 +104,7 @@ static int clk_mt6797_mm_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index bbbc8119c3af920bebf2534bd9203709c1a995ee..de857894e0338fdc434e166cad8ae4c8ed68b9a4 100644 (file)
@@ -56,7 +56,7 @@ static const struct of_device_id of_match_clk_mt6797_vdec[] = {
 
 static int clk_mt6797_vdec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -65,7 +65,7 @@ static int clk_mt6797_vdec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 2c75f0cbfb516e3a115451bf0af98e0afad8abfa..78b7ed55f9799d5bdb7acc35c5b10d862b8f7fd3 100644 (file)
@@ -41,7 +41,7 @@ static const struct of_device_id of_match_clk_mt6797_venc[] = {
 
 static int clk_mt6797_venc_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -50,7 +50,7 @@ static int clk_mt6797_venc_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, venc_clks, ARRAY_SIZE(venc_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 518791c0840c20c63b03ee9891d21126d18963b2..b89f325a4b9b8476074f4fe96786a4b8aa0567be 100644 (file)
@@ -383,7 +383,7 @@ static const struct mtk_composite top_muxes[] = {
 
 static int mtk_topckgen_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        struct device_node *node = pdev->dev.of_node;
 
@@ -399,7 +399,7 @@ static int mtk_topckgen_init(struct platform_device *pdev)
        mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base,
                                    &mt6797_clk_lock, clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct mtk_gate_regs infra0_cg_regs = {
@@ -556,7 +556,7 @@ static const struct mtk_fixed_factor infra_fixed_divs[] = {
        FACTOR(CLK_INFRA_13M, "clk13m", "clk26m", 1, 2),
 };
 
-static struct clk_onecell_data *infra_clk_data;
+static struct clk_hw_onecell_data *infra_clk_data;
 
 static void mtk_infrasys_init_early(struct device_node *node)
 {
@@ -566,13 +566,14 @@ static void mtk_infrasys_init_early(struct device_node *node)
                infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
 
                for (i = 0; i < CLK_INFRA_NR; i++)
-                       infra_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
+                       infra_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
        }
 
        mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs),
                                 infra_clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                  infra_clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                       __func__, r);
@@ -590,8 +591,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
                infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
        } else {
                for (i = 0; i < CLK_INFRA_NR; i++) {
-                       if (infra_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
-                               infra_clk_data->clks[i] = ERR_PTR(-ENOENT);
+                       if (infra_clk_data->hws[i] == ERR_PTR(-EPROBE_DEFER))
+                               infra_clk_data->hws[i] = ERR_PTR(-ENOENT);
                }
        }
 
@@ -600,7 +601,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
        mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs),
                                 infra_clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                     infra_clk_data);
 }
 
 #define MT6797_PLL_FMAX                (3000UL * MHZ)
@@ -659,7 +661,7 @@ static const struct mtk_pll_data plls[] = {
 
 static int mtk_apmixedsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR);
@@ -668,7 +670,7 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
 
        mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt6797[] = {
index 2bd4295bc36be878e0ae803edf91d0ac24d039e3..9f2e5aa7b5d9baae18f37d4326b862df42285b34 100644 (file)
@@ -132,7 +132,7 @@ static const struct mtk_gate audio_clks[] = {
 
 static int clk_mt7622_audiosys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -141,7 +141,7 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r) {
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index c9947dc7ba5a2b4301c9d23368e5d3025a760d38..b12d48705496ece46153a8d989dc2deb42204c13 100644 (file)
@@ -67,7 +67,7 @@ static const struct mtk_gate sgmii_clks[] = {
 
 static int clk_mt7622_ethsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -76,7 +76,7 @@ static int clk_mt7622_ethsys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, eth_clks, ARRAY_SIZE(eth_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
@@ -89,7 +89,7 @@ static int clk_mt7622_ethsys_init(struct platform_device *pdev)
 
 static int clk_mt7622_sgmiisys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -98,7 +98,7 @@ static int clk_mt7622_sgmiisys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, sgmii_clks, ARRAY_SIZE(sgmii_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 628be0c9f8888053d3c0d3d8ea494daf91618304..58728e35e80a9d0d3a72707af9383f9bc821efb0 100644 (file)
@@ -78,7 +78,7 @@ static const struct mtk_gate pcie_clks[] = {
 
 static int clk_mt7622_ssusbsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -87,7 +87,7 @@ static int clk_mt7622_ssusbsys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, ssusb_clks, ARRAY_SIZE(ssusb_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
@@ -100,7 +100,7 @@ static int clk_mt7622_ssusbsys_init(struct platform_device *pdev)
 
 static int clk_mt7622_pciesys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -109,7 +109,7 @@ static int clk_mt7622_pciesys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, pcie_clks, ARRAY_SIZE(pcie_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 7543c6de01a0c05785a7e4f3f0dd4adfcaa627c4..e4a5e5230861b2a60cadcb58956bdfcc6bdcc1b7 100644 (file)
@@ -612,7 +612,7 @@ static struct mtk_composite peri_muxes[] = {
 
 static int mtk_topckgen_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        struct device_node *node = pdev->dev.of_node;
 
@@ -637,17 +637,17 @@ static int mtk_topckgen_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
                               clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_TOP_AXI_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_MEM_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_DDRPHYCFG_SEL]);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_AXI_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_MEM_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_DDRPHYCFG_SEL]->clk);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static int mtk_infrasys_init(struct platform_device *pdev)
 {
        struct device_node *node = pdev->dev.of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
@@ -658,8 +658,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
        mtk_clk_register_cpumuxes(node, infra_muxes, ARRAY_SIZE(infra_muxes),
                                  clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get,
-                               clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                  clk_data);
        if (r)
                return r;
 
@@ -670,7 +670,7 @@ static int mtk_infrasys_init(struct platform_device *pdev)
 
 static int mtk_apmixedsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
@@ -683,15 +683,15 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, apmixed_clks,
                               ARRAY_SIZE(apmixed_clks), clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_APMIXED_ARMPLL]);
-       clk_prepare_enable(clk_data->clks[CLK_APMIXED_MAIN_CORE_EN]);
+       clk_prepare_enable(clk_data->hws[CLK_APMIXED_ARMPLL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_APMIXED_MAIN_CORE_EN]->clk);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static int mtk_pericfg_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
        struct device_node *node = pdev->dev.of_node;
@@ -708,11 +708,11 @@ static int mtk_pericfg_init(struct platform_device *pdev)
        mtk_clk_register_composites(peri_muxes, ARRAY_SIZE(peri_muxes), base,
                                    &mt7622_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                return r;
 
-       clk_prepare_enable(clk_data->clks[CLK_PERI_UART0_PD]);
+       clk_prepare_enable(clk_data->hws[CLK_PERI_UART0_PD]->clk);
 
        mtk_register_reset_controller(node, 2, 0x0);
 
index 88279d0ea1a76a49c0f1cc07242bf1ca0490eecf..c49fd732c9b29b0894686eb9beb8a261e837f23a 100644 (file)
@@ -78,7 +78,7 @@ static const struct mtk_gate sgmii_clks[2][4] = {
 
 static int clk_mt7629_ethsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -86,7 +86,7 @@ static int clk_mt7629_ethsys_init(struct platform_device *pdev)
 
        mtk_clk_register_gates(node, eth_clks, CLK_ETH_NR_CLK, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
@@ -99,7 +99,7 @@ static int clk_mt7629_ethsys_init(struct platform_device *pdev)
 
 static int clk_mt7629_sgmiisys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        static int id;
        int r;
@@ -109,7 +109,7 @@ static int clk_mt7629_sgmiisys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, sgmii_clks[id++], CLK_SGMII_NR_CLK,
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 5c5b37207afbd2f01c0dcabadf75035882aec003..acaa97fda331e1a7f8a21572e1f33a3afc5ec4a9 100644 (file)
@@ -73,7 +73,7 @@ static const struct mtk_gate pcie_clks[] = {
 
 static int clk_mt7629_ssusbsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -82,7 +82,7 @@ static int clk_mt7629_ssusbsys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, ssusb_clks, ARRAY_SIZE(ssusb_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
@@ -95,7 +95,7 @@ static int clk_mt7629_ssusbsys_init(struct platform_device *pdev)
 
 static int clk_mt7629_pciesys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -104,7 +104,7 @@ static int clk_mt7629_pciesys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, pcie_clks, ARRAY_SIZE(pcie_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                dev_err(&pdev->dev,
                        "could not register clock provider: %s: %d\n",
index 289b7d5f8b8b11e690efec4ad32a0d79b8ab97fd..e4a08c811adc279b8b3972e04e162990eec3de67 100644 (file)
@@ -572,7 +572,7 @@ static struct mtk_composite peri_muxes[] = {
 
 static int mtk_topckgen_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        struct device_node *node = pdev->dev.of_node;
 
@@ -591,17 +591,17 @@ static int mtk_topckgen_init(struct platform_device *pdev)
        mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes),
                                    base, &mt7629_clk_lock, clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_TOP_AXI_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_MEM_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_DDRPHYCFG_SEL]);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_AXI_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_MEM_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_DDRPHYCFG_SEL]->clk);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static int mtk_infrasys_init(struct platform_device *pdev)
 {
        struct device_node *node = pdev->dev.of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
 
        clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
 
@@ -611,13 +611,13 @@ static int mtk_infrasys_init(struct platform_device *pdev)
        mtk_clk_register_cpumuxes(node, infra_muxes, ARRAY_SIZE(infra_muxes),
                                  clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get,
-                                  clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                     clk_data);
 }
 
 static int mtk_pericfg_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
        struct device_node *node = pdev->dev.of_node;
@@ -634,18 +634,18 @@ static int mtk_pericfg_init(struct platform_device *pdev)
        mtk_clk_register_composites(peri_muxes, ARRAY_SIZE(peri_muxes), base,
                                    &mt7629_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                return r;
 
-       clk_prepare_enable(clk_data->clks[CLK_PERI_UART0_PD]);
+       clk_prepare_enable(clk_data->hws[CLK_PERI_UART0_PD]->clk);
 
        return 0;
 }
 
 static int mtk_apmixedsys_init(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
@@ -658,10 +658,10 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)
        mtk_clk_register_gates(node, apmixed_clks,
                               ARRAY_SIZE(apmixed_clks), clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_APMIXED_ARMPLL]);
-       clk_prepare_enable(clk_data->clks[CLK_APMIXED_MAIN_CORE_EN]);
+       clk_prepare_enable(clk_data->hws[CLK_APMIXED_ARMPLL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_APMIXED_MAIN_CORE_EN]->clk);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 
index b624c70636c494562f1cf3ef4f2989037512050c..62080ee4dbe35dfd3acb352a8170cbb7eb0fc68c 100644 (file)
@@ -67,7 +67,7 @@ static const struct of_device_id of_match_clk_mt7986_apmixed[] = {
 
 static int clk_mt7986_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -77,9 +77,9 @@ static int clk_mt7986_apmixed_probe(struct platform_device *pdev)
 
        mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_APMIXED_ARMPLL]);
+       clk_prepare_enable(clk_data->hws[CLK_APMIXED_ARMPLL]->clk);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r) {
                pr_err("%s(): could not register clock provider: %d\n",
                       __func__, r);
index ed2e7b200987708f71ad8f06f37aa7433461d0f9..7868c0728e9620c02ef8b8307e54079e7f82b6e6 100644 (file)
@@ -79,7 +79,7 @@ static const struct mtk_gate eth_clks[] __initconst = {
 
 static void __init mtk_sgmiisys_0_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(ARRAY_SIZE(sgmii0_clks));
@@ -87,7 +87,7 @@ static void __init mtk_sgmiisys_0_init(struct device_node *node)
        mtk_clk_register_gates(node, sgmii0_clks, ARRAY_SIZE(sgmii0_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                       __func__, r);
@@ -97,7 +97,7 @@ CLK_OF_DECLARE(mtk_sgmiisys_0, "mediatek,mt7986-sgmiisys_0",
 
 static void __init mtk_sgmiisys_1_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(ARRAY_SIZE(sgmii1_clks));
@@ -105,7 +105,7 @@ static void __init mtk_sgmiisys_1_init(struct device_node *node)
        mtk_clk_register_gates(node, sgmii1_clks, ARRAY_SIZE(sgmii1_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -116,14 +116,14 @@ CLK_OF_DECLARE(mtk_sgmiisys_1, "mediatek,mt7986-sgmiisys_1",
 
 static void __init mtk_ethsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(ARRAY_SIZE(eth_clks));
 
        mtk_clk_register_gates(node, eth_clks, ARRAY_SIZE(eth_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index f209c559fbc3ac3f3f8aa104c1fcf93e070caf38..d90727a53283c70e7ac1a627c1387b96c36688e0 100644 (file)
@@ -171,7 +171,7 @@ static const struct mtk_gate infra_clks[] = {
 
 static int clk_mt7986_infracfg_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
        void __iomem *base;
@@ -195,7 +195,7 @@ static int clk_mt7986_infracfg_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
                               clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r) {
                pr_err("%s(): could not register clock provider: %d\n",
                       __func__, r);
index 8f6f79b6e31efb1338661eea5fa529989c925a5c..de5121cf28774f718116015bbbb361071332e1a3 100644 (file)
@@ -283,7 +283,7 @@ static const struct mtk_mux top_muxes[] = {
 
 static int clk_mt7986_topckgen_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
        void __iomem *base;
@@ -306,14 +306,14 @@ static int clk_mt7986_topckgen_probe(struct platform_device *pdev)
        mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes), node,
                               &mt7986_clk_lock, clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_TOP_SYSAXI_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_SYSAPB_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_DRAMC_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_DRAMC_MD32_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_F26M_SEL]);
-       clk_prepare_enable(clk_data->clks[CLK_TOP_SGM_REG_SEL]);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_SYSAXI_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_SYSAPB_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_DRAMC_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_DRAMC_MD32_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_F26M_SEL]->clk);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_SGM_REG_SEL]->clk);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r) {
                pr_err("%s(): could not register clock provider: %d\n",
index fcc761f63dca75093f16ac0a8c0d1261a15ada3b..9ef524b448620d42231d859ed30f9d92ac639a8b 100644 (file)
@@ -516,7 +516,7 @@ static const struct mtk_composite peri_clks[] __initconst = {
 
 static void __init mtk_topckgen_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
 
@@ -533,9 +533,9 @@ static void __init mtk_topckgen_init(struct device_node *node)
        mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base,
                        &mt8135_clk_lock, clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_TOP_CCI_SEL]);
+       clk_prepare_enable(clk_data->hws[CLK_TOP_CCI_SEL]->clk);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -544,7 +544,7 @@ CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt8135-topckgen", mtk_topckgen_init);
 
 static void __init mtk_infrasys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
@@ -552,9 +552,9 @@ static void __init mtk_infrasys_init(struct device_node *node)
        mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
                                                clk_data);
 
-       clk_prepare_enable(clk_data->clks[CLK_INFRA_M4U]);
+       clk_prepare_enable(clk_data->hws[CLK_INFRA_M4U]->clk);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -565,7 +565,7 @@ CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt8135-infracfg", mtk_infrasys_init);
 
 static void __init mtk_pericfg_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        void __iomem *base;
 
@@ -582,7 +582,7 @@ static void __init mtk_pericfg_init(struct device_node *node)
        mtk_clk_register_composites(peri_clks, ARRAY_SIZE(peri_clks), base,
                        &mt8135_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -626,7 +626,7 @@ static const struct mtk_pll_data plls[] = {
 
 static void __init mtk_apmixedsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
        if (!clk_data)
index 3f7bf6485792aabcaac214ed90074d126542304a..ce1ae8d243c33dd3c54364ac90f5555e301a507c 100644 (file)
@@ -50,14 +50,14 @@ static const struct mtk_gate aud_clks[] __initconst = {
 
 static void __init mtk_audsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_AUD_NR_CLK);
 
        mtk_clk_register_gates(node, aud_clks, ARRAY_SIZE(aud_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
index 3b4ec9eae4321ef9f88f28865d4f9eae080a8d89..e359e563d2b79d80cb37b7ec4612b09b20aa51f6 100644 (file)
@@ -43,14 +43,14 @@ static const struct mtk_gate img_clks[] __initconst = {
 
 static void __init mtk_imgsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_IMG_NR_CLK);
 
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 90b871730f2df62c7be597c4426ef18bb6758ae7..4fd82fe87d6e51ed5bad6418247a0ecc60d85342 100644 (file)
@@ -41,14 +41,14 @@ static const struct mtk_gate mfg_clks[] __initconst = {
 
 static void __init mtk_mfgcfg_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_MFG_NR_CLK);
 
        mtk_clk_register_gates(node, mfg_clks, ARRAY_SIZE(mfg_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 963b129aade1c0dacf0094e3b1881cc92f0dc86d..73910060577f6c55f9f803c950d970117ec9f2af 100644 (file)
@@ -101,7 +101,7 @@ static int clk_mt8167_mm_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
        const struct clk_mt8167_mm_driver_data *data;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int ret;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
@@ -115,7 +115,7 @@ static int clk_mt8167_mm_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (ret)
                return ret;
 
index 910b28355ec0eb8e96af829ab02f684e2c48f6b1..ee4fffb6859dabd3d4146943e5d4f45d1fbefc43 100644 (file)
@@ -56,14 +56,14 @@ static const struct mtk_gate vdec_clks[] __initconst = {
 
 static void __init mtk_vdecsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_VDEC_NR_CLK);
 
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
index 1e96d8eddb9f2474c76bfc6f3c83c7ab1f83f140..f900ac4bf7b8d9f86eac5ddf7c397c4e20cade85 100644 (file)
@@ -923,7 +923,7 @@ static const struct mtk_gate top_clks[] __initconst = {
 
 static void __init mtk_topckgen_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        void __iomem *base;
 
@@ -945,7 +945,7 @@ static void __init mtk_topckgen_init(struct device_node *node)
        mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs),
                                base, &mt8167_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -954,7 +954,7 @@ CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt8167-topckgen", mtk_topckgen_init);
 
 static void __init mtk_infracfg_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        void __iomem *base;
 
@@ -969,7 +969,7 @@ static void __init mtk_infracfg_init(struct device_node *node)
        mtk_clk_register_composites(ifr_muxes, ARRAY_SIZE(ifr_muxes), base,
                &mt8167_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -1037,7 +1037,7 @@ static const struct mtk_pll_data plls[] = {
 
 static void __init mtk_apmixedsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
 
@@ -1053,7 +1053,7 @@ static void __init mtk_apmixedsys_init(struct device_node *node)
        mtk_clk_register_dividers(apmixed_adj_divs, ARRAY_SIZE(apmixed_adj_divs),
                base, &mt8167_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
index 36fa20be77b615bd46781691627581b55360a487..8abf42c2030c67b62b449cb5cb6ebd5dc40379f9 100644 (file)
@@ -115,7 +115,7 @@ static int clk_mt8173_mm_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
        const struct clk_mt8173_mm_driver_data *data;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int ret;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
@@ -129,7 +129,7 @@ static int clk_mt8173_mm_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (ret)
                return ret;
 
index 8f82b32764be0d72981da5da44f17e365eda0270..cd3e4758a47e8689a423e8dbaec819beb8dc39fe 100644 (file)
@@ -819,25 +819,25 @@ static const struct mtk_gate venclt_clks[] __initconst = {
        GATE_VENCLT(CLK_VENCLT_CKE1, "venclt_cke1", "venclt_sel", 4),
 };
 
-static struct clk_onecell_data *mt8173_top_clk_data __initdata;
-static struct clk_onecell_data *mt8173_pll_clk_data __initdata;
+static struct clk_hw_onecell_data *mt8173_top_clk_data __initdata;
+static struct clk_hw_onecell_data *mt8173_pll_clk_data __initdata;
 
 static void __init mtk_clk_enable_critical(void)
 {
        if (!mt8173_top_clk_data || !mt8173_pll_clk_data)
                return;
 
-       clk_prepare_enable(mt8173_pll_clk_data->clks[CLK_APMIXED_ARMCA15PLL]);
-       clk_prepare_enable(mt8173_pll_clk_data->clks[CLK_APMIXED_ARMCA7PLL]);
-       clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_MEM_SEL]);
-       clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_DDRPHYCFG_SEL]);
-       clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_CCI400_SEL]);
-       clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_RTC_SEL]);
+       clk_prepare_enable(mt8173_pll_clk_data->hws[CLK_APMIXED_ARMCA15PLL]->clk);
+       clk_prepare_enable(mt8173_pll_clk_data->hws[CLK_APMIXED_ARMCA7PLL]->clk);
+       clk_prepare_enable(mt8173_top_clk_data->hws[CLK_TOP_MEM_SEL]->clk);
+       clk_prepare_enable(mt8173_top_clk_data->hws[CLK_TOP_DDRPHYCFG_SEL]->clk);
+       clk_prepare_enable(mt8173_top_clk_data->hws[CLK_TOP_CCI400_SEL]->clk);
+       clk_prepare_enable(mt8173_top_clk_data->hws[CLK_TOP_RTC_SEL]->clk);
 }
 
 static void __init mtk_topckgen_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
 
@@ -854,7 +854,7 @@ static void __init mtk_topckgen_init(struct device_node *node)
        mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base,
                        &mt8173_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -865,7 +865,7 @@ CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt8173-topckgen", mtk_topckgen_init);
 
 static void __init mtk_infrasys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
@@ -877,7 +877,7 @@ static void __init mtk_infrasys_init(struct device_node *node)
        mtk_clk_register_cpumuxes(node, cpu_muxes, ARRAY_SIZE(cpu_muxes),
                                  clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -888,7 +888,7 @@ CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt8173-infracfg", mtk_infrasys_init);
 
 static void __init mtk_pericfg_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        void __iomem *base;
 
@@ -905,7 +905,7 @@ static void __init mtk_pericfg_init(struct device_node *node)
        mtk_clk_register_composites(peri_clks, ARRAY_SIZE(peri_clks), base,
                        &mt8173_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -991,7 +991,7 @@ static const struct mtk_pll_data plls[] = {
 
 static void __init mtk_apmixedsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        struct clk *clk;
        int r, i;
@@ -1022,15 +1022,15 @@ static void __init mtk_apmixedsys_init(struct device_node *node)
                        continue;
                }
 
-               clk_data->clks[cku->id] = clk;
+               clk_data->hws[cku->id] = __clk_get_hw(clk);
        }
 
        clk = clk_register_divider(NULL, "hdmi_ref", "tvdpll_594m", 0,
                                   base + 0x40, 16, 3, CLK_DIVIDER_POWER_OF_TWO,
                                   NULL);
-       clk_data->clks[CLK_APMIXED_HDMI_REF] = clk;
+       clk_data->hws[CLK_APMIXED_HDMI_REF] = __clk_get_hw(clk);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -1042,7 +1042,7 @@ CLK_OF_DECLARE(mtk_apmixedsys, "mediatek,mt8173-apmixedsys",
 
 static void __init mtk_imgsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_IMG_NR_CLK);
@@ -1050,7 +1050,7 @@ static void __init mtk_imgsys_init(struct device_node *node)
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
@@ -1060,7 +1060,7 @@ CLK_OF_DECLARE(mtk_imgsys, "mediatek,mt8173-imgsys", mtk_imgsys_init);
 
 static void __init mtk_vdecsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_VDEC_NR_CLK);
@@ -1068,7 +1068,7 @@ static void __init mtk_vdecsys_init(struct device_node *node)
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -1077,7 +1077,7 @@ CLK_OF_DECLARE(mtk_vdecsys, "mediatek,mt8173-vdecsys", mtk_vdecsys_init);
 
 static void __init mtk_vencsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_VENC_NR_CLK);
@@ -1085,7 +1085,7 @@ static void __init mtk_vencsys_init(struct device_node *node)
        mtk_clk_register_gates(node, venc_clks, ARRAY_SIZE(venc_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -1094,7 +1094,7 @@ CLK_OF_DECLARE(mtk_vencsys, "mediatek,mt8173-vencsys", mtk_vencsys_init);
 
 static void __init mtk_vencltsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_VENCLT_NR_CLK);
@@ -1102,7 +1102,7 @@ static void __init mtk_vencltsys_init(struct device_node *node)
        mtk_clk_register_gates(node, venclt_clks, ARRAY_SIZE(venclt_clks),
                                                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
index c87450180b7b6f688dfb36d468ff5a85ce86f78d..b2d7746eddbed9d8e4e8442579d4097362caff85 100644 (file)
@@ -69,7 +69,7 @@ static const struct mtk_gate audio_clks[] = {
 
 static int clk_mt8183_audio_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        struct device_node *node = pdev->dev.of_node;
 
@@ -78,7 +78,7 @@ static int clk_mt8183_audio_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
                        clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                return r;
 
index 8643802c44713954cb52e3f80cdc5cf9c4146b92..fcc598a45165c313a1c92a881a3419546e58d0b0 100644 (file)
@@ -36,7 +36,7 @@ static const struct mtk_gate cam_clks[] = {
 
 static int clk_mt8183_cam_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_CAM_NR_CLK);
@@ -44,7 +44,7 @@ static int clk_mt8183_cam_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, cam_clks, ARRAY_SIZE(cam_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_cam[] = {
index 470d676a4a10638b3610439fcc70106c83c77476..eb2def2cf0ae54a394febdde08c65574610b4bd3 100644 (file)
@@ -36,7 +36,7 @@ static const struct mtk_gate img_clks[] = {
 
 static int clk_mt8183_img_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IMG_NR_CLK);
@@ -44,7 +44,7 @@ static int clk_mt8183_img_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_img[] = {
index c5cb76fc9e5e61beae32efbde213dd03d07b697c..b30fc9f47518e9ac3013cd76738f44e7bb761da7 100644 (file)
@@ -29,7 +29,7 @@ static const struct mtk_gate ipu_core0_clks[] = {
 
 static int clk_mt8183_ipu_core0_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IPU_CORE0_NR_CLK);
@@ -37,7 +37,7 @@ static int clk_mt8183_ipu_core0_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, ipu_core0_clks, ARRAY_SIZE(ipu_core0_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_ipu_core0[] = {
index 8fd5fe002890de9e9bd64b38b3eb635dd5a0619a..b378957e11d0f74032d3fc3e90f37fa4803db2d2 100644 (file)
@@ -29,7 +29,7 @@ static const struct mtk_gate ipu_core1_clks[] = {
 
 static int clk_mt8183_ipu_core1_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IPU_CORE1_NR_CLK);
@@ -37,7 +37,7 @@ static int clk_mt8183_ipu_core1_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, ipu_core1_clks, ARRAY_SIZE(ipu_core1_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_ipu_core1[] = {
index 3f37d0ef1df171e77fc1c588051403f339728066..941b43ac8bec6cb61d164128a28c5b93fcd3e6e9 100644 (file)
@@ -27,7 +27,7 @@ static const struct mtk_gate ipu_adl_clks[] = {
 
 static int clk_mt8183_ipu_adl_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IPU_ADL_NR_CLK);
@@ -35,7 +35,7 @@ static int clk_mt8183_ipu_adl_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, ipu_adl_clks, ARRAY_SIZE(ipu_adl_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_ipu_adl[] = {
index 7e0eef79c461e7bf9d9d8afe17ce704162f549b4..ae82c2e17110f3ed2f792974c640b0e58b6cdd35 100644 (file)
@@ -96,7 +96,7 @@ static const struct mtk_gate ipu_conn_clks[] = {
 
 static int clk_mt8183_ipu_conn_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_IPU_CONN_NR_CLK);
@@ -104,7 +104,7 @@ static int clk_mt8183_ipu_conn_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, ipu_conn_clks, ARRAY_SIZE(ipu_conn_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_ipu_conn[] = {
index 37b4162c5882036da6e74afea176361f8a108258..d774edaf760be73b08e3a24b3155da1d465bed6e 100644 (file)
@@ -28,7 +28,7 @@ static const struct mtk_gate mfg_clks[] = {
 
 static int clk_mt8183_mfg_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        pm_runtime_enable(&pdev->dev);
@@ -38,7 +38,7 @@ static int clk_mt8183_mfg_probe(struct platform_device *pdev)
        mtk_clk_register_gates_with_dev(node, mfg_clks, ARRAY_SIZE(mfg_clks),
                        clk_data, &pdev->dev);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_mfg[] = {
index 9d60e09619c19f20d7d848bd55b564fbcabec584..11ecc6fb0065b5c2eacabc1aa413a2e3590ed984 100644 (file)
@@ -86,14 +86,14 @@ static int clk_mt8183_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
 
        mtk_clk_register_gates(node, mm_clks, ARRAY_SIZE(mm_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt8183_mm_drv = {
index 6250fd1e0edc52b00847bbfbe5764a3309010761..0548cde159d09aba75e3bc0116d7807eb14769ad 100644 (file)
@@ -40,7 +40,7 @@ static const struct mtk_gate vdec_clks[] = {
 
 static int clk_mt8183_vdec_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_VDEC_NR_CLK);
@@ -48,7 +48,7 @@ static int clk_mt8183_vdec_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_vdec[] = {
index 6678ef03fab22756a0b4f7f7edb68d460b9041e2..f86ec607d87a999213c7722edc2a2e7c67e82b9d 100644 (file)
@@ -32,7 +32,7 @@ static const struct mtk_gate venc_clks[] = {
 
 static int clk_mt8183_venc_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_VENC_NR_CLK);
@@ -40,7 +40,7 @@ static int clk_mt8183_venc_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, venc_clks, ARRAY_SIZE(venc_clks),
                        clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183_venc[] = {
index c600d1c587ec60bdc13c97df909eec54c00eea4b..b5c17988c337183f5c074546db76e499686838ab 100644 (file)
@@ -1155,7 +1155,7 @@ static const struct mtk_pll_data plls[] = {
 
 static int clk_mt8183_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
@@ -1165,10 +1165,10 @@ static int clk_mt8183_apmixed_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, apmixed_clks, ARRAY_SIZE(apmixed_clks),
                clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
-static struct clk_onecell_data *top_clk_data;
+static struct clk_hw_onecell_data *top_clk_data;
 
 static void clk_mt8183_top_init_early(struct device_node *node)
 {
@@ -1177,12 +1177,12 @@ static void clk_mt8183_top_init_early(struct device_node *node)
        top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 
        for (i = 0; i < CLK_TOP_NR_CLK; i++)
-               top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
+               top_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
 
        mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs),
                        top_clk_data);
 
-       of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       of_clk_add_hw_provider(node, of_clk_hw_onecell_get, top_clk_data);
 }
 
 CLK_OF_DECLARE_DRIVER(mt8183_topckgen, "mediatek,mt8183-topckgen",
@@ -1217,12 +1217,13 @@ static int clk_mt8183_top_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
                top_clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                     top_clk_data);
 }
 
 static int clk_mt8183_infra_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -1231,7 +1232,7 @@ static int clk_mt8183_infra_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
                clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r) {
                dev_err(&pdev->dev,
                        "%s(): could not register clock provider: %d\n",
@@ -1246,7 +1247,7 @@ static int clk_mt8183_infra_probe(struct platform_device *pdev)
 
 static int clk_mt8183_peri_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
 
        clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK);
@@ -1254,12 +1255,12 @@ static int clk_mt8183_peri_probe(struct platform_device *pdev)
        mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
                               clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static int clk_mt8183_mcu_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        void __iomem *base;
 
@@ -1272,7 +1273,7 @@ static int clk_mt8183_mcu_probe(struct platform_device *pdev)
        mtk_clk_register_composites(mcu_muxes, ARRAY_SIZE(mcu_muxes), base,
                        &mt8183_clk_lock, clk_data);
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static const struct of_device_id of_match_clk_mt8183[] = {
index ab702c397a269e868973dea65c4055942d585a15..e692a2a67ce1cd6470e2d89a39701fc3aa98dac9 100644 (file)
@@ -83,7 +83,7 @@ static const struct of_device_id of_match_clk_mt8186_apmixed[] = {
 
 static int clk_mt8186_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -95,7 +95,7 @@ static int clk_mt8186_apmixed_probe(struct platform_device *pdev)
        if (r)
                goto free_apmixed_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_plls;
 
@@ -113,7 +113,7 @@ free_apmixed_data:
 static int clk_mt8186_apmixed_remove(struct platform_device *pdev)
 {
        struct device_node *node = pdev->dev.of_node;
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
 
        of_clk_del_provider(node);
        mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data);
index 80835960f528066bcffa404216b175b1d871bd1a..dfc305c1fc5d8ffd822573d889870abe02136f1e 100644 (file)
@@ -50,7 +50,7 @@ static const struct of_device_id of_match_clk_mt8186_mcu[] = {
 
 static int clk_mt8186_mcu_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
        void __iomem *base;
@@ -70,7 +70,7 @@ static int clk_mt8186_mcu_probe(struct platform_device *pdev)
        if (r)
                goto free_mcu_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_composite_muxes;
 
@@ -87,7 +87,7 @@ free_mcu_data:
 
 static int clk_mt8186_mcu_remove(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
        struct device_node *node = pdev->dev.of_node;
 
        of_clk_del_provider(node);
index 7c5d0b582f599f27f0054ce15dcec77e673d153b..1d33be4079470e814334128ff9f5b661d425692d 100644 (file)
@@ -62,7 +62,7 @@ static int clk_mt8186_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
@@ -73,7 +73,7 @@ static int clk_mt8186_mm_probe(struct platform_device *pdev)
        if (r)
                goto free_mm_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_gates;
 
@@ -92,7 +92,7 @@ static int clk_mt8186_mm_remove(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
 
        of_clk_del_provider(node);
        mtk_clk_unregister_gates(mm_clks, ARRAY_SIZE(mm_clks), clk_data);
index 005d1997f6f4638a37916c694c194db19051d35a..d7f2c4663c853a46bd8beb7a9394b7fc929e9c69 100644 (file)
@@ -691,7 +691,7 @@ static const struct of_device_id of_match_clk_mt8186_topck[] = {
 
 static int clk_mt8186_topck_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
        void __iomem *base;
@@ -730,7 +730,7 @@ static int clk_mt8186_topck_probe(struct platform_device *pdev)
        if (r)
                goto unregister_composite_muxes;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_composite_divs;
 
@@ -755,7 +755,7 @@ free_top_data:
 
 static int clk_mt8186_topck_remove(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
        struct device_node *node = pdev->dev.of_node;
 
        of_clk_del_provider(node);
index f28d56628045ec65d9bd4e62b2c9717594d8ffaf..8c989bffd8c726a8816366f38812df280e18331b 100644 (file)
@@ -79,7 +79,7 @@ static const struct mtk_gate aud_clks[] = {
 
 static int clk_mt8192_aud_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -91,7 +91,7 @@ static int clk_mt8192_aud_probe(struct platform_device *pdev)
        if (r)
                return r;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                return r;
 
index 4a0b4c4bc06a6ce90eb641ebb4ec06281c0cd637..1be3ff4d407db0e4035955f2326f6b46d82a09ae 100644 (file)
@@ -84,7 +84,7 @@ static int clk_mt8192_mm_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK);
@@ -95,7 +95,7 @@ static int clk_mt8192_mm_probe(struct platform_device *pdev)
        if (r)
                return r;
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
 }
 
 static struct platform_driver clk_mt8192_mm_drv = {
index ab27cd66b866919e319ca0d97c27895b25877620..dda211b7a745dee918df738dc5af024ce1d18f86 100644 (file)
@@ -1178,7 +1178,7 @@ static const struct mtk_pll_data plls[] = {
              0, 0, 32, 0x0330, 24, 0, 0, 0, 0x0334, 0),
 };
 
-static struct clk_onecell_data *top_clk_data;
+static struct clk_hw_onecell_data *top_clk_data;
 
 static void clk_mt8192_top_init_early(struct device_node *node)
 {
@@ -1189,11 +1189,11 @@ static void clk_mt8192_top_init_early(struct device_node *node)
                return;
 
        for (i = 0; i < CLK_TOP_NR_CLK; i++)
-               top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
+               top_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
 
        mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs), top_clk_data);
 
-       of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       of_clk_add_hw_provider(node, of_clk_hw_onecell_get, top_clk_data);
 }
 
 CLK_OF_DECLARE_DRIVER(mt8192_topckgen, "mediatek,mt8192-topckgen",
@@ -1222,12 +1222,13 @@ static int clk_mt8192_top_probe(struct platform_device *pdev)
        if (r)
                return r;
 
-       return of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       return of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
+                                     top_clk_data);
 }
 
 static int clk_mt8192_infra_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -1239,7 +1240,7 @@ static int clk_mt8192_infra_probe(struct platform_device *pdev)
        if (r)
                goto free_clk_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto free_clk_data;
 
@@ -1252,7 +1253,7 @@ free_clk_data:
 
 static int clk_mt8192_peri_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -1264,7 +1265,7 @@ static int clk_mt8192_peri_probe(struct platform_device *pdev)
        if (r)
                goto free_clk_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto free_clk_data;
 
@@ -1277,7 +1278,7 @@ free_clk_data:
 
 static int clk_mt8192_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -1290,7 +1291,7 @@ static int clk_mt8192_apmixed_probe(struct platform_device *pdev)
        if (r)
                goto free_clk_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto free_clk_data;
 
index eecc7035a56a7f51572204497ae516122bc765f7..0dfed6ec4d15516830526be86fc44e2a3894e9c5 100644 (file)
@@ -112,7 +112,7 @@ static const struct of_device_id of_match_clk_mt8195_apmixed[] = {
 
 static int clk_mt8195_apmixed_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -128,7 +128,7 @@ static int clk_mt8195_apmixed_probe(struct platform_device *pdev)
        if (r)
                goto unregister_plls;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_gates;
 
@@ -148,7 +148,7 @@ free_apmixed_data:
 static int clk_mt8195_apmixed_remove(struct platform_device *pdev)
 {
        struct device_node *node = pdev->dev.of_node;
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
 
        of_clk_del_provider(node);
        mtk_clk_unregister_gates(apmixed_clks, ARRAY_SIZE(apmixed_clks), clk_data);
index 8cd88dfc3283f125bb9a101784a37250fdf9f38f..0b52f6a009c4bbb735df8d6a776488463fb7fafe 100644 (file)
@@ -58,7 +58,7 @@ static const struct mtk_pll_data apusys_plls[] = {
 
 static int clk_mt8195_apusys_pll_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -70,7 +70,7 @@ static int clk_mt8195_apusys_pll_probe(struct platform_device *pdev)
        if (r)
                goto free_apusys_pll_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_plls;
 
@@ -87,7 +87,7 @@ free_apusys_pll_data:
 
 static int clk_mt8195_apusys_pll_remove(struct platform_device *pdev)
 {
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
        struct device_node *node = pdev->dev.of_node;
 
        of_clk_del_provider(node);
index b602fcd7f1d1edb882b9978607d6483b093af21a..ec70e1f65eafb43c19fcb6c2b9cc962557f23d86 100644 (file)
@@ -1224,7 +1224,7 @@ static const struct of_device_id of_match_clk_mt8195_topck[] = {
 
 static int clk_mt8195_topck_probe(struct platform_device *pdev)
 {
-       struct clk_onecell_data *top_clk_data;
+       struct clk_hw_onecell_data *top_clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
        void __iomem *base;
@@ -1267,7 +1267,7 @@ static int clk_mt8195_topck_probe(struct platform_device *pdev)
        if (r)
                goto unregister_composite_divs;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, top_clk_data);
        if (r)
                goto unregister_gates;
 
@@ -1294,7 +1294,7 @@ free_top_data:
 
 static int clk_mt8195_topck_remove(struct platform_device *pdev)
 {
-       struct clk_onecell_data *top_clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *top_clk_data = platform_get_drvdata(pdev);
        struct device_node *node = pdev->dev.of_node;
 
        of_clk_del_provider(node);
index 3bc7ed19d5508f2638227a98c8e87e50d7b01df1..261a7f76dd3cc12954e4ca166b41505a0dd0fb74 100644 (file)
@@ -92,7 +92,7 @@ static int clk_mt8195_vdo0_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_VDO0_NR_CLK);
@@ -103,7 +103,7 @@ static int clk_mt8195_vdo0_probe(struct platform_device *pdev)
        if (r)
                goto free_vdo0_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_gates;
 
@@ -122,7 +122,7 @@ static int clk_mt8195_vdo0_remove(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
 
        of_clk_del_provider(node);
        mtk_clk_unregister_gates(vdo0_clks, ARRAY_SIZE(vdo0_clks), clk_data);
index 90c738a85ff1f5c472d3e7660fa36f6488dc413e..3378487d2c904c3454fa670aed46bab6a14dd1ae 100644 (file)
@@ -109,7 +109,7 @@ static int clk_mt8195_vdo1_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_VDO1_NR_CLK);
@@ -120,7 +120,7 @@ static int clk_mt8195_vdo1_probe(struct platform_device *pdev)
        if (r)
                goto free_vdo1_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_gates;
 
@@ -139,7 +139,7 @@ static int clk_mt8195_vdo1_remove(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = dev->parent->of_node;
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
 
        of_clk_del_provider(node);
        mtk_clk_unregister_gates(vdo1_clks, ARRAY_SIZE(vdo1_clks), clk_data);
index 6ab3a06dc9d598062972a8c8c37a2bae727382e9..90f48068a8de7007367d033d41ca1ee1ff6b2bbc 100644 (file)
@@ -49,14 +49,14 @@ static const struct mtk_gate aud_clks[] __initconst = {
 
 static void __init mtk_audsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
 
        clk_data = mtk_alloc_clk_data(CLK_AUD_NR_CLK);
 
        mtk_clk_register_gates(node, aud_clks, ARRAY_SIZE(aud_clks), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
index 8b44e79748034df396d633f899a088249f76bfb1..b96db88893e23cc844473758d0d928085bf017b6 100644 (file)
@@ -677,7 +677,7 @@ static const struct mtk_gate top_clks[] __initconst = {
 
 static void __init mtk_topckgen_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        void __iomem *base;
 
@@ -699,7 +699,7 @@ static void __init mtk_topckgen_init(struct device_node *node)
        mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs),
                                base, &mt8516_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -708,7 +708,7 @@ CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt8516-topckgen", mtk_topckgen_init);
 
 static void __init mtk_infracfg_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        int r;
        void __iomem *base;
 
@@ -723,7 +723,7 @@ static void __init mtk_infracfg_init(struct device_node *node)
        mtk_clk_register_composites(ifr_muxes, ARRAY_SIZE(ifr_muxes), base,
                &mt8516_clk_lock, clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
@@ -787,7 +787,7 @@ static const struct mtk_pll_data plls[] = {
 
 static void __init mtk_apmixedsys_init(struct device_node *node)
 {
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        void __iomem *base;
        int r;
 
@@ -801,7 +801,7 @@ static void __init mtk_apmixedsys_init(struct device_node *node)
 
        mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                pr_err("%s(): could not register clock provider: %d\n",
                        __func__, r);
index 52bacce5dadd5068561609ce6b64695d366db7c6..cfcf740e4e6846b667f26bfb0c4e0377a568c4b3 100644 (file)
 #include "clk-mtk.h"
 #include "clk-gate.h"
 
-struct clk_onecell_data *mtk_alloc_clk_data(unsigned int clk_num)
+struct clk_hw_onecell_data *mtk_alloc_clk_data(unsigned int clk_num)
 {
        int i;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
 
-       clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
+       clk_data = kzalloc(struct_size(clk_data, hws, clk_num), GFP_KERNEL);
        if (!clk_data)
                return NULL;
 
-       clk_data->clks = kcalloc(clk_num, sizeof(*clk_data->clks), GFP_KERNEL);
-       if (!clk_data->clks)
-               goto err_out;
-
-       clk_data->clk_num = clk_num;
+       clk_data->num = clk_num;
 
        for (i = 0; i < clk_num; i++)
-               clk_data->clks[i] = ERR_PTR(-ENOENT);
+               clk_data->hws[i] = ERR_PTR(-ENOENT);
 
        return clk_data;
-err_out:
-       kfree(clk_data);
-
-       return NULL;
 }
 EXPORT_SYMBOL_GPL(mtk_alloc_clk_data);
 
-void mtk_free_clk_data(struct clk_onecell_data *clk_data)
+void mtk_free_clk_data(struct clk_hw_onecell_data *clk_data)
 {
-       if (!clk_data)
-               return;
-
-       kfree(clk_data->clks);
        kfree(clk_data);
 }
+EXPORT_SYMBOL_GPL(mtk_free_clk_data);
 
 int mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks, int num,
-                               struct clk_onecell_data *clk_data)
+                               struct clk_hw_onecell_data *clk_data)
 {
        int i;
        struct clk *clk;
@@ -65,7 +54,7 @@ int mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks, int num,
        for (i = 0; i < num; i++) {
                const struct mtk_fixed_clk *rc = &clks[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[rc->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[rc->id])) {
                        pr_warn("Trying to register duplicate clock ID: %d\n", rc->id);
                        continue;
                }
@@ -78,7 +67,7 @@ int mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks, int num,
                        goto err;
                }
 
-               clk_data->clks[rc->id] = clk;
+               clk_data->hws[rc->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -87,11 +76,11 @@ err:
        while (--i >= 0) {
                const struct mtk_fixed_clk *rc = &clks[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[rc->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[rc->id]))
                        continue;
 
-               clk_unregister_fixed_rate(clk_data->clks[rc->id]);
-               clk_data->clks[rc->id] = ERR_PTR(-ENOENT);
+               clk_unregister_fixed_rate(clk_data->hws[rc->id]->clk);
+               clk_data->hws[rc->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
@@ -99,7 +88,7 @@ err:
 EXPORT_SYMBOL_GPL(mtk_clk_register_fixed_clks);
 
 void mtk_clk_unregister_fixed_clks(const struct mtk_fixed_clk *clks, int num,
-                                  struct clk_onecell_data *clk_data)
+                                  struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
@@ -109,17 +98,17 @@ void mtk_clk_unregister_fixed_clks(const struct mtk_fixed_clk *clks, int num,
        for (i = num; i > 0; i--) {
                const struct mtk_fixed_clk *rc = &clks[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[rc->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[rc->id]))
                        continue;
 
-               clk_unregister_fixed_rate(clk_data->clks[rc->id]);
-               clk_data->clks[rc->id] = ERR_PTR(-ENOENT);
+               clk_unregister_fixed_rate(clk_data->hws[rc->id]->clk);
+               clk_data->hws[rc->id] = ERR_PTR(-ENOENT);
        }
 }
 EXPORT_SYMBOL_GPL(mtk_clk_unregister_fixed_clks);
 
 int mtk_clk_register_factors(const struct mtk_fixed_factor *clks, int num,
-                            struct clk_onecell_data *clk_data)
+                            struct clk_hw_onecell_data *clk_data)
 {
        int i;
        struct clk *clk;
@@ -130,7 +119,7 @@ int mtk_clk_register_factors(const struct mtk_fixed_factor *clks, int num,
        for (i = 0; i < num; i++) {
                const struct mtk_fixed_factor *ff = &clks[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[ff->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[ff->id])) {
                        pr_warn("Trying to register duplicate clock ID: %d\n", ff->id);
                        continue;
                }
@@ -143,7 +132,7 @@ int mtk_clk_register_factors(const struct mtk_fixed_factor *clks, int num,
                        goto err;
                }
 
-               clk_data->clks[ff->id] = clk;
+               clk_data->hws[ff->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -152,11 +141,11 @@ err:
        while (--i >= 0) {
                const struct mtk_fixed_factor *ff = &clks[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[ff->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[ff->id]))
                        continue;
 
-               clk_unregister_fixed_factor(clk_data->clks[ff->id]);
-               clk_data->clks[ff->id] = ERR_PTR(-ENOENT);
+               clk_unregister_fixed_factor(clk_data->hws[ff->id]->clk);
+               clk_data->hws[ff->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
@@ -164,7 +153,7 @@ err:
 EXPORT_SYMBOL_GPL(mtk_clk_register_factors);
 
 void mtk_clk_unregister_factors(const struct mtk_fixed_factor *clks, int num,
-                               struct clk_onecell_data *clk_data)
+                               struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
@@ -174,11 +163,11 @@ void mtk_clk_unregister_factors(const struct mtk_fixed_factor *clks, int num,
        for (i = num; i > 0; i--) {
                const struct mtk_fixed_factor *ff = &clks[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[ff->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[ff->id]))
                        continue;
 
-               clk_unregister_fixed_factor(clk_data->clks[ff->id]);
-               clk_data->clks[ff->id] = ERR_PTR(-ENOENT);
+               clk_unregister_fixed_factor(clk_data->hws[ff->id]->clk);
+               clk_data->hws[ff->id] = ERR_PTR(-ENOENT);
        }
 }
 EXPORT_SYMBOL_GPL(mtk_clk_unregister_factors);
@@ -298,7 +287,7 @@ static void mtk_clk_unregister_composite(struct clk *clk)
 
 int mtk_clk_register_composites(const struct mtk_composite *mcs, int num,
                                void __iomem *base, spinlock_t *lock,
-                               struct clk_onecell_data *clk_data)
+                               struct clk_hw_onecell_data *clk_data)
 {
        struct clk *clk;
        int i;
@@ -309,7 +298,7 @@ int mtk_clk_register_composites(const struct mtk_composite *mcs, int num,
        for (i = 0; i < num; i++) {
                const struct mtk_composite *mc = &mcs[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[mc->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[mc->id])) {
                        pr_warn("Trying to register duplicate clock ID: %d\n",
                                mc->id);
                        continue;
@@ -322,7 +311,7 @@ int mtk_clk_register_composites(const struct mtk_composite *mcs, int num,
                        goto err;
                }
 
-               clk_data->clks[mc->id] = clk;
+               clk_data->hws[mc->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -331,11 +320,11 @@ err:
        while (--i >= 0) {
                const struct mtk_composite *mc = &mcs[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mcs->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mcs->id]))
                        continue;
 
-               mtk_clk_unregister_composite(clk_data->clks[mc->id]);
-               clk_data->clks[mc->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_composite(clk_data->hws[mc->id]->clk);
+               clk_data->hws[mc->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
@@ -343,7 +332,7 @@ err:
 EXPORT_SYMBOL_GPL(mtk_clk_register_composites);
 
 void mtk_clk_unregister_composites(const struct mtk_composite *mcs, int num,
-                                  struct clk_onecell_data *clk_data)
+                                  struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
@@ -353,18 +342,18 @@ void mtk_clk_unregister_composites(const struct mtk_composite *mcs, int num,
        for (i = num; i > 0; i--) {
                const struct mtk_composite *mc = &mcs[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mc->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mc->id]))
                        continue;
 
-               mtk_clk_unregister_composite(clk_data->clks[mc->id]);
-               clk_data->clks[mc->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_composite(clk_data->hws[mc->id]->clk);
+               clk_data->hws[mc->id] = ERR_PTR(-ENOENT);
        }
 }
 EXPORT_SYMBOL_GPL(mtk_clk_unregister_composites);
 
 int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num,
                              void __iomem *base, spinlock_t *lock,
-                             struct clk_onecell_data *clk_data)
+                             struct clk_hw_onecell_data *clk_data)
 {
        struct clk *clk;
        int i;
@@ -375,7 +364,7 @@ int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num,
        for (i = 0; i <  num; i++) {
                const struct mtk_clk_divider *mcd = &mcds[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[mcd->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[mcd->id])) {
                        pr_warn("Trying to register duplicate clock ID: %d\n",
                                mcd->id);
                        continue;
@@ -390,7 +379,7 @@ int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num,
                        goto err;
                }
 
-               clk_data->clks[mcd->id] = clk;
+               clk_data->hws[mcd->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -399,18 +388,18 @@ err:
        while (--i >= 0) {
                const struct mtk_clk_divider *mcd = &mcds[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mcd->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mcd->id]))
                        continue;
 
-               mtk_clk_unregister_composite(clk_data->clks[mcd->id]);
-               clk_data->clks[mcd->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_composite(clk_data->hws[mcd->id]->clk);
+               clk_data->hws[mcd->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
 }
 
 void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num,
-                                struct clk_onecell_data *clk_data)
+                                struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
@@ -420,18 +409,18 @@ void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num,
        for (i = num; i > 0; i--) {
                const struct mtk_clk_divider *mcd = &mcds[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mcd->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mcd->id]))
                        continue;
 
-               clk_unregister_divider(clk_data->clks[mcd->id]);
-               clk_data->clks[mcd->id] = ERR_PTR(-ENOENT);
+               clk_unregister_divider(clk_data->hws[mcd->id]->clk);
+               clk_data->hws[mcd->id] = ERR_PTR(-ENOENT);
        }
 }
 
 int mtk_clk_simple_probe(struct platform_device *pdev)
 {
        const struct mtk_clk_desc *mcd;
-       struct clk_onecell_data *clk_data;
+       struct clk_hw_onecell_data *clk_data;
        struct device_node *node = pdev->dev.of_node;
        int r;
 
@@ -447,7 +436,7 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
        if (r)
                goto free_data;
 
-       r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
+       r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
        if (r)
                goto unregister_clks;
 
@@ -465,7 +454,7 @@ free_data:
 int mtk_clk_simple_remove(struct platform_device *pdev)
 {
        const struct mtk_clk_desc *mcd = of_device_get_match_data(&pdev->dev);
-       struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
+       struct clk_hw_onecell_data *clk_data = platform_get_drvdata(pdev);
        struct device_node *node = pdev->dev.of_node;
 
        of_clk_del_provider(node);
index 9577084790dc664ac01022450e62ff7fbc1348a6..e736420170a2464b2f5146523e2ff696bada1dda 100644 (file)
@@ -35,9 +35,9 @@ struct mtk_fixed_clk {
        }
 
 int mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks, int num,
-                               struct clk_onecell_data *clk_data);
+                               struct clk_hw_onecell_data *clk_data);
 void mtk_clk_unregister_fixed_clks(const struct mtk_fixed_clk *clks, int num,
-                                  struct clk_onecell_data *clk_data);
+                                  struct clk_hw_onecell_data *clk_data);
 
 struct mtk_fixed_factor {
        int id;
@@ -56,9 +56,9 @@ struct mtk_fixed_factor {
        }
 
 int mtk_clk_register_factors(const struct mtk_fixed_factor *clks, int num,
-                            struct clk_onecell_data *clk_data);
+                            struct clk_hw_onecell_data *clk_data);
 void mtk_clk_unregister_factors(const struct mtk_fixed_factor *clks, int num,
-                               struct clk_onecell_data *clk_data);
+                               struct clk_hw_onecell_data *clk_data);
 
 struct mtk_composite {
        int id;
@@ -149,9 +149,9 @@ struct mtk_composite {
 
 int mtk_clk_register_composites(const struct mtk_composite *mcs, int num,
                                void __iomem *base, spinlock_t *lock,
-                               struct clk_onecell_data *clk_data);
+                               struct clk_hw_onecell_data *clk_data);
 void mtk_clk_unregister_composites(const struct mtk_composite *mcs, int num,
-                                  struct clk_onecell_data *clk_data);
+                                  struct clk_hw_onecell_data *clk_data);
 
 struct mtk_clk_divider {
        int id;
@@ -177,12 +177,12 @@ struct mtk_clk_divider {
 
 int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num,
                              void __iomem *base, spinlock_t *lock,
-                             struct clk_onecell_data *clk_data);
+                             struct clk_hw_onecell_data *clk_data);
 void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num,
-                                struct clk_onecell_data *clk_data);
+                                struct clk_hw_onecell_data *clk_data);
 
-struct clk_onecell_data *mtk_alloc_clk_data(unsigned int clk_num);
-void mtk_free_clk_data(struct clk_onecell_data *clk_data);
+struct clk_hw_onecell_data *mtk_alloc_clk_data(unsigned int clk_num);
+void mtk_free_clk_data(struct clk_hw_onecell_data *clk_data);
 
 struct clk *mtk_clk_register_ref2usb_tx(const char *name,
                        const char *parent_name, void __iomem *reg);
index 21ad5a4afd65c537453101ee671271bbd4ff0339..2f47e59cc5288e2e11abba60257b3e227e7ba609 100644 (file)
@@ -193,7 +193,7 @@ static void mtk_clk_unregister_mux(struct clk *clk)
 int mtk_clk_register_muxes(const struct mtk_mux *muxes,
                           int num, struct device_node *node,
                           spinlock_t *lock,
-                          struct clk_onecell_data *clk_data)
+                          struct clk_hw_onecell_data *clk_data)
 {
        struct regmap *regmap;
        struct clk *clk;
@@ -208,7 +208,7 @@ int mtk_clk_register_muxes(const struct mtk_mux *muxes,
        for (i = 0; i < num; i++) {
                const struct mtk_mux *mux = &muxes[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[mux->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[mux->id])) {
                        pr_warn("%pOF: Trying to register duplicate clock ID: %d\n",
                                node, mux->id);
                        continue;
@@ -221,7 +221,7 @@ int mtk_clk_register_muxes(const struct mtk_mux *muxes,
                        goto err;
                }
 
-               clk_data->clks[mux->id] = clk;
+               clk_data->hws[mux->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -230,11 +230,11 @@ err:
        while (--i >= 0) {
                const struct mtk_mux *mux = &muxes[i];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mux->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
                        continue;
 
-               mtk_clk_unregister_mux(clk_data->clks[mux->id]);
-               clk_data->clks[mux->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_mux(clk_data->hws[mux->id]->clk);
+               clk_data->hws[mux->id] = ERR_PTR(-ENOENT);
        }
 
        return PTR_ERR(clk);
@@ -242,7 +242,7 @@ err:
 EXPORT_SYMBOL_GPL(mtk_clk_register_muxes);
 
 void mtk_clk_unregister_muxes(const struct mtk_mux *muxes, int num,
-                             struct clk_onecell_data *clk_data)
+                             struct clk_hw_onecell_data *clk_data)
 {
        int i;
 
@@ -252,11 +252,11 @@ void mtk_clk_unregister_muxes(const struct mtk_mux *muxes, int num,
        for (i = num; i > 0; i--) {
                const struct mtk_mux *mux = &muxes[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[mux->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
                        continue;
 
-               mtk_clk_unregister_mux(clk_data->clks[mux->id]);
-               clk_data->clks[mux->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_mux(clk_data->hws[mux->id]->clk);
+               clk_data->hws[mux->id] = ERR_PTR(-ENOENT);
        }
 }
 EXPORT_SYMBOL_GPL(mtk_clk_unregister_muxes);
index 903a3c937959bfdf159f30670c3baebc15489cc4..6539c58f5d7df1f4d200ba3c911f507c613d260e 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/types.h>
 
 struct clk;
-struct clk_onecell_data;
+struct clk_hw_onecell_data;
 struct clk_ops;
 struct device_node;
 
@@ -84,9 +84,9 @@ extern const struct clk_ops mtk_mux_gate_clr_set_upd_ops;
 int mtk_clk_register_muxes(const struct mtk_mux *muxes,
                           int num, struct device_node *node,
                           spinlock_t *lock,
-                          struct clk_onecell_data *clk_data);
+                          struct clk_hw_onecell_data *clk_data);
 
 void mtk_clk_unregister_muxes(const struct mtk_mux *muxes, int num,
-                             struct clk_onecell_data *clk_data);
+                             struct clk_hw_onecell_data *clk_data);
 
 #endif /* __DRV_CLK_MTK_MUX_H */
index a7fcdc189ecdb1a3f78fef3f74acefa23ac5af37..1b3122f69c3b7d2ba52ba215a0f8419b18c2cbd3 100644 (file)
@@ -375,7 +375,7 @@ static void mtk_clk_unregister_pll(struct clk *clk)
 
 int mtk_clk_register_plls(struct device_node *node,
                          const struct mtk_pll_data *plls, int num_plls,
-                         struct clk_onecell_data *clk_data)
+                         struct clk_hw_onecell_data *clk_data)
 {
        void __iomem *base;
        int i;
@@ -390,7 +390,7 @@ int mtk_clk_register_plls(struct device_node *node,
        for (i = 0; i < num_plls; i++) {
                const struct mtk_pll_data *pll = &plls[i];
 
-               if (!IS_ERR_OR_NULL(clk_data->clks[pll->id])) {
+               if (!IS_ERR_OR_NULL(clk_data->hws[pll->id])) {
                        pr_warn("%pOF: Trying to register duplicate clock ID: %d\n",
                                node, pll->id);
                        continue;
@@ -403,7 +403,7 @@ int mtk_clk_register_plls(struct device_node *node,
                        goto err;
                }
 
-               clk_data->clks[pll->id] = clk;
+               clk_data->hws[pll->id] = __clk_get_hw(clk);
        }
 
        return 0;
@@ -412,8 +412,8 @@ err:
        while (--i >= 0) {
                const struct mtk_pll_data *pll = &plls[i];
 
-               mtk_clk_unregister_pll(clk_data->clks[pll->id]);
-               clk_data->clks[pll->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_pll(clk_data->hws[pll->id]->clk);
+               clk_data->hws[pll->id] = ERR_PTR(-ENOENT);
        }
 
        iounmap(base);
@@ -422,17 +422,16 @@ err:
 }
 EXPORT_SYMBOL_GPL(mtk_clk_register_plls);
 
-static __iomem void *mtk_clk_pll_get_base(struct clk *clk,
+static __iomem void *mtk_clk_pll_get_base(struct clk_hw *hw,
                                          const struct mtk_pll_data *data)
 {
-       struct clk_hw *hw = __clk_get_hw(clk);
        struct mtk_clk_pll *pll = to_mtk_clk_pll(hw);
 
        return pll->base_addr - data->reg;
 }
 
 void mtk_clk_unregister_plls(const struct mtk_pll_data *plls, int num_plls,
-                            struct clk_onecell_data *clk_data)
+                            struct clk_hw_onecell_data *clk_data)
 {
        __iomem void *base = NULL;
        int i;
@@ -443,7 +442,7 @@ void mtk_clk_unregister_plls(const struct mtk_pll_data *plls, int num_plls,
        for (i = num_plls; i > 0; i--) {
                const struct mtk_pll_data *pll = &plls[i - 1];
 
-               if (IS_ERR_OR_NULL(clk_data->clks[pll->id]))
+               if (IS_ERR_OR_NULL(clk_data->hws[pll->id]))
                        continue;
 
                /*
@@ -452,10 +451,10 @@ void mtk_clk_unregister_plls(const struct mtk_pll_data *plls, int num_plls,
                 * pointer to the I/O region base address. We have to fetch
                 * it from one of the registered clks.
                 */
-               base = mtk_clk_pll_get_base(clk_data->clks[pll->id], pll);
+               base = mtk_clk_pll_get_base(clk_data->hws[pll->id], pll);
 
-               mtk_clk_unregister_pll(clk_data->clks[pll->id]);
-               clk_data->clks[pll->id] = ERR_PTR(-ENOENT);
+               mtk_clk_unregister_pll(clk_data->hws[pll->id]->clk);
+               clk_data->hws[pll->id] = ERR_PTR(-ENOENT);
        }
 
        iounmap(base);
index bf06e44caef93cec1eff406027aa1cdf60eaa0e0..fe319971568864764b6ac4a77d69a3407de1c872 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 
 struct clk_ops;
-struct clk_onecell_data;
+struct clk_hw_onecell_data;
 struct device_node;
 
 struct mtk_pll_div_table {
@@ -50,8 +50,8 @@ struct mtk_pll_data {
 
 int mtk_clk_register_plls(struct device_node *node,
                          const struct mtk_pll_data *plls, int num_plls,
-                         struct clk_onecell_data *clk_data);
+                         struct clk_hw_onecell_data *clk_data);
 void mtk_clk_unregister_plls(const struct mtk_pll_data *plls, int num_plls,
-                            struct clk_onecell_data *clk_data);
+                            struct clk_hw_onecell_data *clk_data);
 
 #endif /* __DRV_CLK_MTK_PLL_H */