Commit 73d37e4c authored by Peter De Schrijver's avatar Peter De Schrijver

clk: tegra: add clkdev registration infra

Add a common infra for registering clkdev. This allows decoupling clk
registration from clkdev registration.
Signed-off-by: default avatarPeter De Schrijver <pdeschrijver@nvidia.com>
parent b8700d50
This diff is collapsed.
...@@ -212,6 +212,15 @@ void __init tegra_add_of_provider(struct device_node *np) ...@@ -212,6 +212,15 @@ void __init tegra_add_of_provider(struct device_node *np)
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
} }
void __init tegra_register_devclks(struct tegra_devclk *dev_clks, int num)
{
int i;
for (i = 0; i < num; i++, dev_clks++)
clk_register_clkdev(clks[dev_clks->dt_id], dev_clks->con_id,
dev_clks->dev_id);
}
struct clk ** __init tegra_lookup_dt_id(int clk_id, struct clk ** __init tegra_lookup_dt_id(int clk_id,
struct tegra_clk *tegra_clk) struct tegra_clk *tegra_clk)
{ {
......
...@@ -573,6 +573,12 @@ struct tegra_clk { ...@@ -573,6 +573,12 @@ struct tegra_clk {
bool present; bool present;
}; };
struct tegra_devclk {
int dt_id;
char *dev_id;
char *con_id;
};
void tegra_init_from_table(struct tegra_clk_init_table *tbl, void tegra_init_from_table(struct tegra_clk_init_table *tbl,
struct clk *clks[], int clk_max); struct clk *clks[], int clk_max);
...@@ -585,6 +591,7 @@ struct clk **tegra_clk_init(int num, int periph_banks); ...@@ -585,6 +591,7 @@ struct clk **tegra_clk_init(int num, int periph_banks);
struct clk **tegra_lookup_dt_id(int clk_id, struct tegra_clk *tegra_clk); struct clk **tegra_lookup_dt_id(int clk_id, struct tegra_clk *tegra_clk);
void tegra_add_of_provider(struct device_node *np); void tegra_add_of_provider(struct device_node *np);
void tegra_register_devclks(struct tegra_devclk *dev_clks, int num);
void tegra114_clock_tune_cpu_trimmers_high(void); void tegra114_clock_tune_cpu_trimmers_high(void);
void tegra114_clock_tune_cpu_trimmers_low(void); void tegra114_clock_tune_cpu_trimmers_low(void);
......
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