[ARM] pxa: move camera (QCI) registers definition out of pxa-regs.h
[linux-2.6] / arch / arm / mach-pxa / clock.h
1 #include <linux/list.h>
2
3 struct clk;
4
5 struct clkops {
6         void                    (*enable)(struct clk *);
7         void                    (*disable)(struct clk *);
8         unsigned long           (*getrate)(struct clk *);
9 };
10
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;
21 };
22
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,                       \
31         }
32
33 #define INIT_CK(_name, _cken, _ops, _dev)               \
34         {                                               \
35                 .name   = _name,                        \
36                 .dev    = _dev,                         \
37                 .ops    = _ops,                         \
38                 .cken   = CKEN_##_cken,                 \
39         }
40
41 /*
42  * This is a placeholder to alias one clock device+name pair
43  * to another struct clk.
44  */
45 #define INIT_CKOTHER(_name, _other, _dev)               \
46         {                                               \
47                 .name   = _name,                        \
48                 .dev    = _dev,                         \
49                 .other  = _other,                       \
50         }
51
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,                       \
59         }
60
61 extern const struct clkops clk_cken_ops;
62
63 void clk_cken_enable(struct clk *clk);
64 void clk_cken_disable(struct clk *clk);
65
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,                       \
75         }
76
77 #define PXA3xx_CK(_name, _cken, _ops, _dev)             \
78         {                                               \
79                 .name   = _name,                        \
80                 .dev    = _dev,                         \
81                 .ops    = _ops,                         \
82                 .cken   = CKEN_##_cken,                 \
83         }
84
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
89
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);
93