MIPS: SB1250: Include correct header and fix a warning
[linux-2.6/linux-mips.git] / arch / powerpc / kernel / clock.c
blobce668f545758cf7bf92231b5d888a48132d7b80b
1 /*
2 * Dummy clk implementations for powerpc.
3 * These need to be overridden in platform code.
4 */
6 #include <linux/clk.h>
7 #include <linux/err.h>
8 #include <linux/errno.h>
9 #include <linux/module.h>
10 #include <asm/clk_interface.h>
12 struct clk_interface clk_functions;
14 struct clk *clk_get(struct device *dev, const char *id)
16 if (clk_functions.clk_get)
17 return clk_functions.clk_get(dev, id);
18 return ERR_PTR(-ENOSYS);
20 EXPORT_SYMBOL(clk_get);
22 void clk_put(struct clk *clk)
24 if (clk_functions.clk_put)
25 clk_functions.clk_put(clk);
27 EXPORT_SYMBOL(clk_put);
29 int clk_enable(struct clk *clk)
31 if (clk_functions.clk_enable)
32 return clk_functions.clk_enable(clk);
33 return -ENOSYS;
35 EXPORT_SYMBOL(clk_enable);
37 void clk_disable(struct clk *clk)
39 if (clk_functions.clk_disable)
40 clk_functions.clk_disable(clk);
42 EXPORT_SYMBOL(clk_disable);
44 unsigned long clk_get_rate(struct clk *clk)
46 if (clk_functions.clk_get_rate)
47 return clk_functions.clk_get_rate(clk);
48 return 0;
50 EXPORT_SYMBOL(clk_get_rate);
52 long clk_round_rate(struct clk *clk, unsigned long rate)
54 if (clk_functions.clk_round_rate)
55 return clk_functions.clk_round_rate(clk, rate);
56 return -ENOSYS;
58 EXPORT_SYMBOL(clk_round_rate);
60 int clk_set_rate(struct clk *clk, unsigned long rate)
62 if (clk_functions.clk_set_rate)
63 return clk_functions.clk_set_rate(clk, rate);
64 return -ENOSYS;
66 EXPORT_SYMBOL(clk_set_rate);
68 struct clk *clk_get_parent(struct clk *clk)
70 if (clk_functions.clk_get_parent)
71 return clk_functions.clk_get_parent(clk);
72 return ERR_PTR(-ENOSYS);
74 EXPORT_SYMBOL(clk_get_parent);
76 int clk_set_parent(struct clk *clk, struct clk *parent)
78 if (clk_functions.clk_set_parent)
79 return clk_functions.clk_set_parent(clk, parent);
80 return -ENOSYS;
82 EXPORT_SYMBOL(clk_set_parent);