Commit 9d8d1fe5 authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Stephen Boyd

clk: mediatek: clk-mt7986-topckgen: Migrate to mtk_clk_simple_probe()

There are no more non-common calls in clk_mt7986_topckgen_probe():
migrate this driver to mtk_clk_simple_probe().
Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: default avatarMiles Chen <miles.chen@mediatek.com>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230120092053.182923-24-angelogioacchino.delregno@collabora.comTested-by: default avatarMingming Su <mingming.su@mediatek.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent a0c3ef25
...@@ -290,53 +290,24 @@ static const struct mtk_mux top_muxes[] = { ...@@ -290,53 +290,24 @@ static const struct mtk_mux top_muxes[] = {
0x1C4, 5), 0x1C4, 5),
}; };
static int clk_mt7986_topckgen_probe(struct platform_device *pdev) static const struct mtk_clk_desc topck_desc = {
{ .fixed_clks = top_fixed_clks,
struct clk_hw_onecell_data *clk_data; .num_fixed_clks = ARRAY_SIZE(top_fixed_clks),
struct device_node *node = pdev->dev.of_node; .factor_clks = top_divs,
int r; .num_factor_clks = ARRAY_SIZE(top_divs),
void __iomem *base; .mux_clks = top_muxes,
int nr = ARRAY_SIZE(top_fixed_clks) + ARRAY_SIZE(top_divs) + .num_mux_clks = ARRAY_SIZE(top_muxes),
ARRAY_SIZE(top_muxes); .clk_lock = &mt7986_clk_lock,
};
base = of_iomap(node, 0);
if (!base) {
pr_err("%s(): ioremap failed\n", __func__);
return -ENOMEM;
}
clk_data = mtk_alloc_clk_data(nr);
if (!clk_data)
return -ENOMEM;
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(&pdev->dev, top_muxes,
ARRAY_SIZE(top_muxes), node,
&mt7986_clk_lock, 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);
goto free_topckgen_data;
}
return r;
free_topckgen_data:
mtk_free_clk_data(clk_data);
return r;
}
static const struct of_device_id of_match_clk_mt7986_topckgen[] = { static const struct of_device_id of_match_clk_mt7986_topckgen[] = {
{ .compatible = "mediatek,mt7986-topckgen", }, { .compatible = "mediatek,mt7986-topckgen", .data = &topck_desc },
{} { /* sentinel */ }
}; };
static struct platform_driver clk_mt7986_topckgen_drv = { static struct platform_driver clk_mt7986_topckgen_drv = {
.probe = clk_mt7986_topckgen_probe, .probe = mtk_clk_simple_probe,
.remove = mtk_clk_simple_remove,
.driver = { .driver = {
.name = "clk-mt7986-topckgen", .name = "clk-mt7986-topckgen",
.of_match_table = of_match_clk_mt7986_topckgen, .of_match_table = of_match_clk_mt7986_topckgen,
......
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