dm exception store: introduce area_location function
[linux-2.6/mini2440.git] / arch / arm / mach-pxa / clock.h
blob73be795fe3bfe5dcb04a25fa95c2488910efa20c
1 #include <linux/list.h>
3 struct clk;
5 struct clkops {
6 void (*enable)(struct clk *);
7 void (*disable)(struct clk *);
8 unsigned long (*getrate)(struct clk *);
9 };
11 struct clk {
12 struct list_head node;
13 const char *name;
14 struct device *dev;
15 const struct clkops *ops;
16 unsigned long rate;
17 unsigned int cken;
18 unsigned int delay;
19 unsigned int enabled;
20 struct clk *other;
23 #define INIT_CKEN(_name, _cken, _rate, _delay, _dev) \
24 { \
25 .name = _name, \
26 .dev = _dev, \
27 .ops = &clk_cken_ops, \
28 .rate = _rate, \
29 .cken = CKEN_##_cken, \
30 .delay = _delay, \
33 #define INIT_CK(_name, _cken, _ops, _dev) \
34 { \
35 .name = _name, \
36 .dev = _dev, \
37 .ops = _ops, \
38 .cken = CKEN_##_cken, \
42 * This is a placeholder to alias one clock device+name pair
43 * to another struct clk.
45 #define INIT_CKOTHER(_name, _other, _dev) \
46 { \
47 .name = _name, \
48 .dev = _dev, \
49 .other = _other, \
52 #define INIT_CLK(_name, _ops, _rate, _delay, _dev) \
53 { \
54 .name = _name, \
55 .dev = _dev, \
56 .ops = _ops, \
57 .rate = _rate, \
58 .delay = _delay, \
61 extern const struct clkops clk_cken_ops;
63 void clk_cken_enable(struct clk *clk);
64 void clk_cken_disable(struct clk *clk);
66 #ifdef CONFIG_PXA3xx
67 #define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
68 { \
69 .name = _name, \
70 .dev = _dev, \
71 .ops = &clk_pxa3xx_cken_ops, \
72 .rate = _rate, \
73 .cken = CKEN_##_cken, \
74 .delay = _delay, \
77 #define PXA3xx_CK(_name, _cken, _ops, _dev) \
78 { \
79 .name = _name, \
80 .dev = _dev, \
81 .ops = _ops, \
82 .cken = CKEN_##_cken, \
85 extern const struct clkops clk_pxa3xx_cken_ops;
86 extern void clk_pxa3xx_cken_enable(struct clk *);
87 extern void clk_pxa3xx_cken_disable(struct clk *);
88 #endif
90 void clks_register(struct clk *clks, size_t num);
91 int clk_add_alias(char *alias, struct device *alias_dev, char *id,
92 struct device *dev);