Commit 6b7daeaa authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Stephen Boyd

clk: mediatek: Propagate struct device with mtk_clk_register_dividers()

Propagate struct device for divider clocks registered through clk-mtk
helpers to be able to get runtime PM support for MTK clocks.
Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Tested-by: Chen-Yu Tsai <wenst@chromium.org> # MT8183, MT8192, MT8195 Chromebooks
Link: https://lore.kernel.org/r/20230306140543.1813621-32-angelogioacchino.delregno@collabora.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 876d4e21
...@@ -681,7 +681,7 @@ static int mtk_topckgen_init(struct platform_device *pdev) ...@@ -681,7 +681,7 @@ static int mtk_topckgen_init(struct platform_device *pdev)
ARRAY_SIZE(top_muxes), base, ARRAY_SIZE(top_muxes), base,
&mt2701_clk_lock, clk_data); &mt2701_clk_lock, clk_data);
mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), mtk_clk_register_dividers(&pdev->dev, top_adj_divs, ARRAY_SIZE(top_adj_divs),
base, &mt2701_clk_lock, clk_data); base, &mt2701_clk_lock, clk_data);
mtk_clk_register_gates(&pdev->dev, node, top_clks, mtk_clk_register_gates(&pdev->dev, node, top_clks,
......
...@@ -109,7 +109,7 @@ static int clk_mt8167_apmixed_probe(struct platform_device *pdev) ...@@ -109,7 +109,7 @@ static int clk_mt8167_apmixed_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = mtk_clk_register_dividers(adj_divs, ARRAY_SIZE(adj_divs), base, ret = mtk_clk_register_dividers(dev, adj_divs, ARRAY_SIZE(adj_divs), base,
&mt8167_apmixed_clk_lock, clk_data); &mt8167_apmixed_clk_lock, clk_data);
if (ret) if (ret)
goto unregister_plls; goto unregister_plls;
......
...@@ -393,7 +393,8 @@ void mtk_clk_unregister_composites(const struct mtk_composite *mcs, int num, ...@@ -393,7 +393,8 @@ void mtk_clk_unregister_composites(const struct mtk_composite *mcs, int num,
} }
EXPORT_SYMBOL_GPL(mtk_clk_unregister_composites); EXPORT_SYMBOL_GPL(mtk_clk_unregister_composites);
int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num, int mtk_clk_register_dividers(struct device *dev,
const struct mtk_clk_divider *mcds, int num,
void __iomem *base, spinlock_t *lock, void __iomem *base, spinlock_t *lock,
struct clk_hw_onecell_data *clk_data) struct clk_hw_onecell_data *clk_data)
{ {
...@@ -412,7 +413,7 @@ int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num, ...@@ -412,7 +413,7 @@ int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num,
continue; continue;
} }
hw = clk_hw_register_divider(NULL, mcd->name, mcd->parent_name, hw = clk_hw_register_divider(dev, mcd->name, mcd->parent_name,
mcd->flags, base + mcd->div_reg, mcd->div_shift, mcd->flags, base + mcd->div_reg, mcd->div_shift,
mcd->div_width, mcd->clk_divider_flags, lock); mcd->div_width, mcd->clk_divider_flags, lock);
...@@ -535,7 +536,8 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev, ...@@ -535,7 +536,8 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev,
} }
if (mcd->divider_clks) { if (mcd->divider_clks) {
r = mtk_clk_register_dividers(mcd->divider_clks, r = mtk_clk_register_dividers(&pdev->dev,
mcd->divider_clks,
mcd->num_divider_clks, mcd->num_divider_clks,
base, mcd->clk_lock, clk_data); base, mcd->clk_lock, clk_data);
if (r) if (r)
......
...@@ -202,7 +202,8 @@ struct mtk_clk_divider { ...@@ -202,7 +202,8 @@ struct mtk_clk_divider {
.div_width = _width, \ .div_width = _width, \
} }
int mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, int num, int mtk_clk_register_dividers(struct device *dev,
const struct mtk_clk_divider *mcds, int num,
void __iomem *base, spinlock_t *lock, void __iomem *base, spinlock_t *lock,
struct clk_hw_onecell_data *clk_data); struct clk_hw_onecell_data *clk_data);
void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num, void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment