]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: mediatek: clk-mux: Propagate struct device for mtk-mux
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Fri, 20 Jan 2023 09:20:36 +0000 (10:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2024 15:07:13 +0000 (17:07 +0200)
[ Upstream commit d3d6bd5e25cdc460df33ae1db4f051c4bdd3aa60 ]

Like done for other clocks, propagate struct device for mtk mux clocks
registered through clk-mux helpers to enable runtime pm support.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230120092053.182923-7-angelogioacchino.delregno@collabora.com
Tested-by: Mingming Su <mingming.su@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Stable-dep-of: 2f7b1d8b5505 ("clk: mediatek: Do a runtime PM get on controllers during probe")
Signed-off-by: Sasha Levin <sashal@kernel.org>
12 files changed:
drivers/clk/mediatek/clk-mt6765.c
drivers/clk/mediatek/clk-mt6779.c
drivers/clk/mediatek/clk-mt6795-topckgen.c
drivers/clk/mediatek/clk-mt7986-infracfg.c
drivers/clk/mediatek/clk-mt7986-topckgen.c
drivers/clk/mediatek/clk-mt8183.c
drivers/clk/mediatek/clk-mt8186-topckgen.c
drivers/clk/mediatek/clk-mt8192.c
drivers/clk/mediatek/clk-mt8195-topckgen.c
drivers/clk/mediatek/clk-mt8365.c
drivers/clk/mediatek/clk-mux.c
drivers/clk/mediatek/clk-mux.h

index 4a7bc6e04580d5fd8471f5b4f90d611c9fa5259b..c4941523f5520f1bc0956e70c64101a04104d4eb 100644 (file)
@@ -782,7 +782,8 @@ static int clk_mt6765_top_probe(struct platform_device *pdev)
                                    clk_data);
        mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs),
                                 clk_data);
-       mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes), node,
+       mtk_clk_register_muxes(&pdev->dev, top_muxes,
+                              ARRAY_SIZE(top_muxes), node,
                               &mt6765_clk_lock, clk_data);
        mtk_clk_register_gates(&pdev->dev, node, top_clks,
                               ARRAY_SIZE(top_clks), clk_data);
index 2c20e40d7c80900f24428587eef2a6e2d5522ca7..7fe9d12b2dfddfd7887efef547b0f4fb1f4df52d 100644 (file)
@@ -1248,8 +1248,9 @@ static int clk_mt6779_top_probe(struct platform_device *pdev)
 
        mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data);
 
-       mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes),
-                              node, &mt6779_clk_lock, clk_data);
+       mtk_clk_register_muxes(&pdev->dev, top_muxes,
+                              ARRAY_SIZE(top_muxes), node,
+                              &mt6779_clk_lock, clk_data);
 
        mtk_clk_register_composites(&pdev->dev, top_aud_muxes,
                                    ARRAY_SIZE(top_aud_muxes), base,
index 845cc870493039a615ad789b39fbe5f2ef52c1e6..2ab8bf5d6d6d99b128c4f07edcc4383ab158a8c5 100644 (file)
@@ -552,7 +552,8 @@ static int clk_mt6795_topckgen_probe(struct platform_device *pdev)
        if (ret)
                goto unregister_fixed_clks;
 
-       ret = mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes), node,
+       ret = mtk_clk_register_muxes(&pdev->dev, top_muxes,
+                                    ARRAY_SIZE(top_muxes), node,
                                     &mt6795_top_clk_lock, clk_data);
        if (ret)
                goto unregister_factors;
index 578f150e0ee52cadcf6f22847f3746be9cda61d3..0a4bf87ee160705d04d33be411d57df1c3bdfbce 100644 (file)
@@ -178,7 +178,8 @@ static int clk_mt7986_infracfg_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        mtk_clk_register_factors(infra_divs, ARRAY_SIZE(infra_divs), clk_data);
-       mtk_clk_register_muxes(infra_muxes, ARRAY_SIZE(infra_muxes), node,
+       mtk_clk_register_muxes(&pdev->dev, infra_muxes,
+                              ARRAY_SIZE(infra_muxes), node,
                               &mt7986_clk_lock, clk_data);
        mtk_clk_register_gates(&pdev->dev, node, infra_clks,
                               ARRAY_SIZE(infra_clks), clk_data);
index de5121cf28774f718116015bbbb361071332e1a3..c9bf47e6098fdfca74e6560f1c279d3b8c72b565 100644 (file)
@@ -303,7 +303,8 @@ static int clk_mt7986_topckgen_probe(struct platform_device *pdev)
        mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),
                                    clk_data);
        mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data);
-       mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes), node,
+       mtk_clk_register_muxes(&pdev->dev, top_muxes,
+                              ARRAY_SIZE(top_muxes), node,
                               &mt7986_clk_lock, clk_data);
 
        clk_prepare_enable(clk_data->hws[CLK_TOP_SYSAXI_SEL]->clk);
index bf7b342332536653bb7f987218707317a3a58651..78620244144e8895c8d871e2b9fec9af634aa559 100644 (file)
@@ -1238,8 +1238,9 @@ static int clk_mt8183_top_probe(struct platform_device *pdev)
 
        mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), top_clk_data);
 
-       mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes),
-               node, &mt8183_clk_lock, top_clk_data);
+       mtk_clk_register_muxes(&pdev->dev, top_muxes,
+                              ARRAY_SIZE(top_muxes), node,
+                              &mt8183_clk_lock, top_clk_data);
 
        mtk_clk_register_composites(&pdev->dev, top_aud_muxes,
                                    ARRAY_SIZE(top_aud_muxes), base,
index 4ac157320a6b9e8c6642b743e41bfb4d5d322321..70b6e008a188b243e32d02675b48456c31d57cd0 100644 (file)
@@ -715,7 +715,8 @@ static int clk_mt8186_topck_probe(struct platform_device *pdev)
        if (r)
                goto unregister_fixed_clks;
 
-       r = mtk_clk_register_muxes(top_mtk_muxes, ARRAY_SIZE(top_mtk_muxes), node,
+       r = mtk_clk_register_muxes(&pdev->dev, top_mtk_muxes,
+                                  ARRAY_SIZE(top_mtk_muxes), node,
                                   &mt8186_clk_lock, clk_data);
        if (r)
                goto unregister_factors;
index ab856d0276184771dd63c1b2a721f71293f2bc65..16feb86dcb1b8655c61c24c508da9d3c48e2620f 100644 (file)
@@ -1112,7 +1112,8 @@ static int clk_mt8192_top_probe(struct platform_device *pdev)
        if (r)
                goto unregister_early_factors;
 
-       r = mtk_clk_register_muxes(top_mtk_muxes, ARRAY_SIZE(top_mtk_muxes), node,
+       r = mtk_clk_register_muxes(&pdev->dev, top_mtk_muxes,
+                                  ARRAY_SIZE(top_mtk_muxes), node,
                                   &mt8192_clk_lock, top_clk_data);
        if (r)
                goto unregister_factors;
index aae31ef3903de7a9556110adc2bcc7837405c1ea..3485ebb17ab830ea82f0b933b7a9418c8121d2e0 100644 (file)
@@ -1262,7 +1262,8 @@ static int clk_mt8195_topck_probe(struct platform_device *pdev)
        if (r)
                goto unregister_fixed_clks;
 
-       r = mtk_clk_register_muxes(top_mtk_muxes, ARRAY_SIZE(top_mtk_muxes), node,
+       r = mtk_clk_register_muxes(&pdev->dev, top_mtk_muxes,
+                                  ARRAY_SIZE(top_mtk_muxes), node,
                                   &mt8195_clk_lock, top_clk_data);
        if (r)
                goto unregister_factors;
index 0482a8aa43cc9af524f0d7bb5a8037a219c013c5..c9faa07ec0a6403bc3b365dc2c07705fefc68406 100644 (file)
@@ -947,7 +947,8 @@ static int clk_mt8365_top_probe(struct platform_device *pdev)
        if (ret)
                goto unregister_fixed_clks;
 
-       ret = mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes), node,
+       ret = mtk_clk_register_muxes(&pdev->dev, top_muxes,
+                                    ARRAY_SIZE(top_muxes), node,
                                     &mt8365_clk_lock, clk_data);
        if (ret)
                goto unregister_factors;
index ba1720b9e23101929a54b4c09955f0ec93d52342..c8593554239d6e9da6612161a9479291f2e2b884 100644 (file)
@@ -154,9 +154,10 @@ const struct clk_ops mtk_mux_gate_clr_set_upd_ops  = {
 };
 EXPORT_SYMBOL_GPL(mtk_mux_gate_clr_set_upd_ops);
 
-static struct clk_hw *mtk_clk_register_mux(const struct mtk_mux *mux,
-                                struct regmap *regmap,
-                                spinlock_t *lock)
+static struct clk_hw *mtk_clk_register_mux(struct device *dev,
+                                          const struct mtk_mux *mux,
+                                          struct regmap *regmap,
+                                          spinlock_t *lock)
 {
        struct mtk_clk_mux *clk_mux;
        struct clk_init_data init = {};
@@ -177,7 +178,7 @@ static struct clk_hw *mtk_clk_register_mux(const struct mtk_mux *mux,
        clk_mux->lock = lock;
        clk_mux->hw.init = &init;
 
-       ret = clk_hw_register(NULL, &clk_mux->hw);
+       ret = clk_hw_register(dev, &clk_mux->hw);
        if (ret) {
                kfree(clk_mux);
                return ERR_PTR(ret);
@@ -198,7 +199,8 @@ static void mtk_clk_unregister_mux(struct clk_hw *hw)
        kfree(mux);
 }
 
-int mtk_clk_register_muxes(const struct mtk_mux *muxes,
+int mtk_clk_register_muxes(struct device *dev,
+                          const struct mtk_mux *muxes,
                           int num, struct device_node *node,
                           spinlock_t *lock,
                           struct clk_hw_onecell_data *clk_data)
@@ -222,7 +224,7 @@ int mtk_clk_register_muxes(const struct mtk_mux *muxes,
                        continue;
                }
 
-               hw = mtk_clk_register_mux(mux, regmap, lock);
+               hw = mtk_clk_register_mux(dev, mux, regmap, lock);
 
                if (IS_ERR(hw)) {
                        pr_err("Failed to register clk %s: %pe\n", mux->name,
index 83ff420f4ebe6f49627018f6f616a820d6c7b7af..7ecb963b0ec6880e52466248e1832eb25d9eef41 100644 (file)
@@ -83,7 +83,8 @@ extern const struct clk_ops mtk_mux_gate_clr_set_upd_ops;
                        0, _upd_ofs, _upd, CLK_SET_RATE_PARENT,         \
                        mtk_mux_clr_set_upd_ops)
 
-int mtk_clk_register_muxes(const struct mtk_mux *muxes,
+int mtk_clk_register_muxes(struct device *dev,
+                          const struct mtk_mux *muxes,
                           int num, struct device_node *node,
                           spinlock_t *lock,
                           struct clk_hw_onecell_data *clk_data);