OMAP3: PM: Ensure MUSB block can idle when driver not loaded
[linux-ginger.git] / arch / arm / mach-pxa / clock.h
blob5599bceff738341344ca0f1041371453423e41e2
1 #include <asm/clkdev.h>
3 struct clkops {
4 void (*enable)(struct clk *);
5 void (*disable)(struct clk *);
6 unsigned long (*getrate)(struct clk *);
7 };
9 struct clk {
10 const struct clkops *ops;
11 unsigned long rate;
12 unsigned int cken;
13 unsigned int delay;
14 unsigned int enabled;
15 struct clk *other;
18 #define INIT_CLKREG(_clk,_devname,_conname) \
19 { \
20 .clk = _clk, \
21 .dev_id = _devname, \
22 .con_id = _conname, \
25 #define DEFINE_CKEN(_name, _cken, _rate, _delay) \
26 struct clk clk_##_name = { \
27 .ops = &clk_cken_ops, \
28 .rate = _rate, \
29 .cken = CKEN_##_cken, \
30 .delay = _delay, \
33 #define DEFINE_CK(_name, _cken, _ops) \
34 struct clk clk_##_name = { \
35 .ops = _ops, \
36 .cken = CKEN_##_cken, \
39 #define DEFINE_CLK(_name, _ops, _rate, _delay) \
40 struct clk clk_##_name = { \
41 .ops = _ops, \
42 .rate = _rate, \
43 .delay = _delay, \
46 extern const struct clkops clk_cken_ops;
48 void clk_cken_enable(struct clk *clk);
49 void clk_cken_disable(struct clk *clk);
51 #ifdef CONFIG_PXA3xx
52 #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
53 struct clk clk_##_name = { \
54 .ops = &clk_pxa3xx_cken_ops, \
55 .rate = _rate, \
56 .cken = CKEN_##_cken, \
57 .delay = _delay, \
60 #define DEFINE_PXA3_CK(_name, _cken, _ops) \
61 struct clk clk_##_name = { \
62 .ops = _ops, \
63 .cken = CKEN_##_cken, \
66 extern const struct clkops clk_pxa3xx_cken_ops;
67 extern void clk_pxa3xx_cken_enable(struct clk *);
68 extern void clk_pxa3xx_cken_disable(struct clk *);
69 #endif
71 void clks_register(struct clk_lookup *clks, size_t num);
72 int clk_add_alias(const char *alias, const char *alias_name, char *id,
73 struct device *dev);