summaryrefslogtreecommitdiff
path: root/drivers/clk/mediatek/clk-mtk.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wenst@chromium.org>2022-02-08 20:40:05 +0800
committerStephen Boyd <sboyd@kernel.org>2022-02-17 12:12:21 -0800
commit19b8d43887f52e65c38fb828c0976656b6302337 (patch)
treec2ef3833a4bee2a6883e702e15b7ae66e9b46668 /drivers/clk/mediatek/clk-mtk.c
parent2403d6f1b1dac1b7864cd8b9b4a0f7350c63e770 (diff)
clk: mediatek: gate: Consolidate gate type clk related code
Right now some bits of the gate type clk code are in clk-gate.[ch], but other bits are in clk-mtk.[ch]. This is different from the cpumux and mux type clks, for which all of the code are found in the same files. Move the functions that register multiple clks from a given list, mtk_clk_register_gates_with_dev() and mtk_clk_register_gates(), to clk-gate.[ch] to consolidate all the code for the gate type clks. This commit only moves code with minor whitespace fixups to correct the code style. Further improvements, such as internalizing various functions and structures will be done in later commits. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Miles Chen <miles.chen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220208124034.414635-3-wenst@chromium.org Reviewed-by: Chun-Jie Chen <chun-jie.chen@mediatek.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/mediatek/clk-mtk.c')
-rw-r--r--drivers/clk/mediatek/clk-mtk.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index 519a461cbb6f..0c5db3c71fdd 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -106,57 +106,6 @@ void mtk_clk_register_factors(const struct mtk_fixed_factor *clks,
}
EXPORT_SYMBOL_GPL(mtk_clk_register_factors);
-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 device *dev)
-{
- int i;
- struct clk *clk;
- struct regmap *regmap;
-
- if (!clk_data)
- return -ENOMEM;
-
- regmap = device_node_to_regmap(node);
- if (IS_ERR(regmap)) {
- pr_err("Cannot find regmap for %pOF: %pe\n", node, regmap);
- return PTR_ERR(regmap);
- }
-
- for (i = 0; i < num; i++) {
- const struct mtk_gate *gate = &clks[i];
-
- if (!IS_ERR_OR_NULL(clk_data->clks[gate->id]))
- continue;
-
- clk = mtk_clk_register_gate(gate->name, gate->parent_name,
- regmap,
- gate->regs->set_ofs,
- gate->regs->clr_ofs,
- gate->regs->sta_ofs,
- gate->shift, gate->ops, gate->flags, dev);
-
- if (IS_ERR(clk)) {
- pr_err("Failed to register clk %s: %pe\n", gate->name, clk);
- continue;
- }
-
- clk_data->clks[gate->id] = clk;
- }
-
- return 0;
-}
-
-int mtk_clk_register_gates(struct device_node *node,
- const struct mtk_gate *clks,
- int num, struct clk_onecell_data *clk_data)
-{
- return mtk_clk_register_gates_with_dev(node,
- clks, num, clk_data, NULL);
-}
-EXPORT_SYMBOL_GPL(mtk_clk_register_gates);
-
struct clk *mtk_clk_register_composite(const struct mtk_composite *mc,
void __iomem *base, spinlock_t *lock)
{