12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/device.h>
15 #include <linux/list.h>
16 #include <linux/errno.h>
18 #include <linux/string.h>
27 #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
43 of_node_put(clkspec.np);
57 struct clk *of_clk_get_by_name(
struct device_node *np,
const char *
name)
59 struct clk *clk = ERR_PTR(-
ENOENT);
72 clk = of_clk_get(np, index);
75 else if (name && index >= 0) {
76 pr_err(
"ERROR: could not get clock %s:%s(%i)\n",
108 int match, best_found = 0, best_possible = 0;
128 if (match > best_found) {
130 if (match != best_possible)
144 cl = clk_find(dev_id, con_id);
155 const char *dev_id = dev ? dev_name(dev) :
NULL;
159 clk = of_clk_get_by_name(dev->
of_node, con_id);
192 #define MAX_DEV_ID 20
193 #define MAX_CON_ID 16
202 vclkdev_alloc(
struct clk *clk,
const char *con_id,
const char *dev_fmt,
207 cla = __clkdev_alloc(
sizeof(*cla));
226 clkdev_alloc(
struct clk *clk,
const char *con_id,
const char *dev_fmt, ...)
232 cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
284 const char *dev_fmt, ...)
293 cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
322 for (i = 0; i < num; i++, cl++) {