mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 00:10:09 +00:00
clk: of: helper for determining number of parent clocks
Walks the "clocks" array of parent clock phandles and returns the number. Signed-off-by: Mike Turquette <mturquette@linaro.org>
This commit is contained in:
parent
f8fe36f608
commit
f61027426a
2 changed files with 7 additions and 0 deletions
|
@ -2202,6 +2202,12 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
|
||||||
return clk;
|
return clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int of_clk_get_parent_count(struct device_node *np)
|
||||||
|
{
|
||||||
|
return of_count_phandle_with_args(np, "clocks", "#clock-cells");
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(of_clk_get_parent_count);
|
||||||
|
|
||||||
const char *of_clk_get_parent_name(struct device_node *np, int index)
|
const char *of_clk_get_parent_name(struct device_node *np, int index)
|
||||||
{
|
{
|
||||||
struct of_phandle_args clkspec;
|
struct of_phandle_args clkspec;
|
||||||
|
|
|
@ -472,6 +472,7 @@ void of_clk_del_provider(struct device_node *np);
|
||||||
struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
|
struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
|
||||||
void *data);
|
void *data);
|
||||||
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
|
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
|
||||||
|
int of_clk_get_parent_count(struct device_node *np);
|
||||||
const char *of_clk_get_parent_name(struct device_node *np, int index);
|
const char *of_clk_get_parent_name(struct device_node *np, int index);
|
||||||
|
|
||||||
void of_clk_init(const struct of_device_id *matches);
|
void of_clk_init(const struct of_device_id *matches);
|
||||||
|
|
Loading…
Reference in a new issue