clk: mediatek: Add fixed clocks support for Mediatek SoC.

This patch adds fixed clocks support by using CCF fixed-rate
clock implementation.

Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
This commit is contained in:
James Liao
2015-07-10 11:39:15 +08:00
parent e02940fc9e
commit 4fa043806a
2 changed files with 40 additions and 0 deletions

View File

@@ -49,6 +49,29 @@ err_out:
return NULL;
}
void __init mtk_clk_register_fixed_clks(const struct mtk_fixed_clk *clks,
int num, struct clk_onecell_data *clk_data)
{
int i;
struct clk *clk;
for (i = 0; i < num; i++) {
const struct mtk_fixed_clk *rc = &clks[i];
clk = clk_register_fixed_rate(NULL, rc->name, rc->parent,
rc->parent ? 0 : CLK_IS_ROOT, rc->rate);
if (IS_ERR(clk)) {
pr_err("Failed to register clk %s: %ld\n",
rc->name, PTR_ERR(clk));
continue;
}
if (clk_data)
clk_data->clks[rc->id] = clk;
}
}
void __init mtk_clk_register_factors(const struct mtk_fixed_factor *clks,
int num, struct clk_onecell_data *clk_data)
{