aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk-provider.h14
-rw-r--r--include/linux/clk.h19
2 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 06ad617664a2..7c9c691102b5 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -347,5 +347,19 @@ void __clk_unprepare(struct clk *clk);
347void __clk_reparent(struct clk *clk, struct clk *new_parent); 347void __clk_reparent(struct clk *clk, struct clk *new_parent);
348unsigned long __clk_round_rate(struct clk *clk, unsigned long rate); 348unsigned long __clk_round_rate(struct clk *clk, unsigned long rate);
349 349
350struct of_device_id;
351
352typedef void (*of_clk_init_cb_t)(struct device_node *);
353
354int of_clk_add_provider(struct device_node *np,
355 struct clk *(*clk_src_get)(struct of_phandle_args *args,
356 void *data),
357 void *data);
358void of_clk_del_provider(struct device_node *np);
359struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
360 void *data);
361const char *of_clk_get_parent_name(struct device_node *np, int index);
362void of_clk_init(const struct of_device_id *matches);
363
350#endif /* CONFIG_COMMON_CLK */ 364#endif /* CONFIG_COMMON_CLK */
351#endif /* CLK_PROVIDER_H */ 365#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk.h b/include/linux/clk.h
index ad5c43e8ae8a..8b70342e7e0b 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -310,4 +310,23 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id);
310int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, 310int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
311 struct device *dev); 311 struct device *dev);
312 312
313struct device_node;
314struct of_phandle_args;
315
316#ifdef CONFIG_OF
317struct clk *of_clk_get(struct device_node *np, int index);
318struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
319struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
320#else
321static inline struct clk *of_clk_get(struct device_node *np, int index)
322{
323 return NULL;
324}
325static inline struct clk *of_clk_get_by_name(struct device_node *np,
326 const char *name)
327{
328 return NULL;
329}
330#endif
331
313#endif 332#endif