summaryrefslogtreecommitdiff
path: root/drivers/clk/clk.h
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2018-12-19 10:59:55 -0800
committerStephen Boyd <sboyd@kernel.org>2019-03-01 11:17:22 -0800
commit4472287a3b2f52f4aa53f294ccb74392dde4e07d (patch)
tree77f40e0f7e08c1394275664a624628d64cddb064 /drivers/clk/clk.h
parent2447883934a03c80a85d92cd313ea1d10e330158 (diff)
clk: Introduce of_clk_get_hw_from_clkspec()
We want to get struct clk_hw pointers from a DT clk specifier (i.e. a clocks property) so that we can find parent clks without searching for globally unique clk names. This should save time by avoiding the global string search for clks that are external to the clock controller providing the clk and let us move away from string comparisons in general. Introduce of_clk_get_hw_from_clkspec() which is largely the DT parsing part of finding clks implemented in clkdev.c and have that return a clk_hw pointer instead of converting that into a clk pointer. This lets us push up the clk pointer creation to the caller in clk_get() and avoids the need to push the dev_id and con_id throughout the DT parsing code. Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Jerome Brunet <jbrunet@baylibre.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Michael Turquette <mturquette@baylibre.com> Cc: Jeffrey Hugo <jhugo@codeaurora.org> Cc: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk.h')
-rw-r--r--drivers/clk/clk.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h
index 4cdf30b0008c..5a0ca0e3c1f1 100644
--- a/drivers/clk/clk.h
+++ b/drivers/clk/clk.h
@@ -7,8 +7,9 @@
struct clk_hw;
#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
-struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,
- const char *dev_id, const char *con_id);
+int of_parse_clkspec(const struct device_node *np, int index, const char *name,
+ struct of_phandle_args *out_args);
+struct clk_hw *of_clk_get_hw_from_clkspec(struct of_phandle_args *clkspec);
#endif
#ifdef CONFIG_COMMON_CLK