aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clk.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r--include/linux/clk.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index ad5c43e8ae8a..2fd6a4234531 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -12,6 +12,7 @@
12#ifndef __LINUX_CLK_H 12#ifndef __LINUX_CLK_H
13#define __LINUX_CLK_H 13#define __LINUX_CLK_H
14 14
15#include <linux/err.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/notifier.h> 17#include <linux/notifier.h>
17 18
@@ -86,7 +87,7 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
86/** 87/**
87 * clk_get - lookup and obtain a reference to a clock producer. 88 * clk_get - lookup and obtain a reference to a clock producer.
88 * @dev: device for clock "consumer" 89 * @dev: device for clock "consumer"
89 * @id: clock comsumer ID 90 * @id: clock consumer ID
90 * 91 *
91 * Returns a struct clk corresponding to the clock producer, or 92 * Returns a struct clk corresponding to the clock producer, or
92 * valid IS_ERR() condition containing errno. The implementation 93 * valid IS_ERR() condition containing errno. The implementation
@@ -103,7 +104,7 @@ struct clk *clk_get(struct device *dev, const char *id);
103/** 104/**
104 * devm_clk_get - lookup and obtain a managed reference to a clock producer. 105 * devm_clk_get - lookup and obtain a managed reference to a clock producer.
105 * @dev: device for clock "consumer" 106 * @dev: device for clock "consumer"
106 * @id: clock comsumer ID 107 * @id: clock consumer ID
107 * 108 *
108 * Returns a struct clk corresponding to the clock producer, or 109 * Returns a struct clk corresponding to the clock producer, or
109 * valid IS_ERR() condition containing errno. The implementation 110 * valid IS_ERR() condition containing errno. The implementation
@@ -310,4 +311,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, 311int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
311 struct device *dev); 312 struct device *dev);
312 313
314struct device_node;
315struct of_phandle_args;
316
317#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
318struct clk *of_clk_get(struct device_node *np, int index);
319struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
320struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
321#else
322static inline struct clk *of_clk_get(struct device_node *np, int index)
323{
324 return ERR_PTR(-ENOENT);
325}
326static inline struct clk *of_clk_get_by_name(struct device_node *np,
327 const char *name)
328{
329 return ERR_PTR(-ENOENT);
330}
331#endif
332
313#endif 333#endif