MXC arch: Add gpio support for the whole platform
[linux-2.6] / arch / arm / mach-pxa / clock.h
1 struct clk;
2
3 struct clkops {
4         void                    (*enable)(struct clk *);
5         void                    (*disable)(struct clk *);
6         unsigned long           (*getrate)(struct clk *);
7 };
8
9 struct clk {
10         struct list_head        node;
11         const char              *name;
12         struct device           *dev;
13         const struct clkops     *ops;
14         unsigned long           rate;
15         unsigned int            cken;
16         unsigned int            delay;
17         unsigned int            enabled;
18 };
19
20 #define INIT_CKEN(_name, _cken, _rate, _delay, _dev)    \
21         {                                               \
22                 .name   = _name,                        \
23                 .dev    = _dev,                         \
24                 .ops    = &clk_cken_ops,                \
25                 .rate   = _rate,                        \
26                 .cken   = CKEN_##_cken,                 \
27                 .delay  = _delay,                       \
28         }
29
30 #define INIT_CK(_name, _cken, _ops, _dev)               \
31         {                                               \
32                 .name   = _name,                        \
33                 .dev    = _dev,                         \
34                 .ops    = _ops,                         \
35                 .cken   = CKEN_##_cken,                 \
36         }
37
38 extern const struct clkops clk_cken_ops;
39
40 void clk_cken_enable(struct clk *clk);
41 void clk_cken_disable(struct clk *clk);
42
43 void clks_register(struct clk *clks, size_t num);