Commit | Line | Data |
---|---|---|
6d803ba7 | 1 | #include <linux/clkdev.h> |
f113fe4e | 2 | #include <linux/sysdev.h> |
a6dba20c RK |
3 | |
4 | struct clkops { | |
5 | void (*enable)(struct clk *); | |
6 | void (*disable)(struct clk *); | |
7 | unsigned long (*getrate)(struct clk *); | |
8 | }; | |
9 | ||
10 | struct clk { | |
a6dba20c RK |
11 | const struct clkops *ops; |
12 | unsigned long rate; | |
13 | unsigned int cken; | |
14 | unsigned int delay; | |
15 | unsigned int enabled; | |
16 | }; | |
17 | ||
4029813c EM |
18 | void clk_dummy_enable(struct clk *); |
19 | void clk_dummy_disable(struct clk *); | |
20 | ||
21 | extern const struct clkops clk_dummy_ops; | |
22 | extern struct clk clk_dummy; | |
23 | ||
8c3abc7d | 24 | #define INIT_CLKREG(_clk,_devname,_conname) \ |
a6dba20c | 25 | { \ |
8c3abc7d RK |
26 | .clk = _clk, \ |
27 | .dev_id = _devname, \ | |
28 | .con_id = _conname, \ | |
29 | } | |
30 | ||
8c3abc7d RK |
31 | #define DEFINE_CK(_name, _cken, _ops) \ |
32 | struct clk clk_##_name = { \ | |
a6dba20c RK |
33 | .ops = _ops, \ |
34 | .cken = CKEN_##_cken, \ | |
35 | } | |
36 | ||
8c3abc7d RK |
37 | #define DEFINE_CLK(_name, _ops, _rate, _delay) \ |
38 | struct clk clk_##_name = { \ | |
39 | .ops = _ops, \ | |
40 | .rate = _rate, \ | |
ed847782 IM |
41 | .delay = _delay, \ |
42 | } | |
43 | ||
4029813c | 44 | #define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \ |
8c3abc7d | 45 | struct clk clk_##_name = { \ |
4029813c | 46 | .ops = &clk_pxa2xx_cken_ops, \ |
7a2c5cb0 | 47 | .rate = _rate, \ |
48 | .cken = CKEN_##_cken, \ | |
49 | .delay = _delay, \ | |
50 | } | |
51 | ||
4029813c | 52 | extern const struct clkops clk_pxa2xx_cken_ops; |
a6dba20c | 53 | |
4029813c EM |
54 | void clk_pxa2xx_cken_enable(struct clk *clk); |
55 | void clk_pxa2xx_cken_disable(struct clk *clk); | |
a6dba20c | 56 | |
f113fe4e EM |
57 | extern struct sysdev_class pxa2xx_clock_sysclass; |
58 | ||
a4553358 | 59 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) |
8c3abc7d | 60 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ |
8c3abc7d | 61 | struct clk clk_##_name = { \ |
7a2c5cb0 | 62 | .ops = &clk_pxa3xx_cken_ops, \ |
63 | .rate = _rate, \ | |
7a2c5cb0 | 64 | .cken = CKEN_##_cken, \ |
7a2c5cb0 | 65 | .delay = _delay, \ |
7a2c5cb0 | 66 | } |
67 | ||
68 | extern const struct clkops clk_pxa3xx_cken_ops; | |
4029813c EM |
69 | extern const struct clkops clk_pxa3xx_hsio_ops; |
70 | extern const struct clkops clk_pxa3xx_ac97_ops; | |
71 | extern const struct clkops clk_pxa3xx_pout_ops; | |
c085052b | 72 | extern const struct clkops clk_pxa3xx_smemc_ops; |
4029813c | 73 | |
7a2c5cb0 | 74 | extern void clk_pxa3xx_cken_enable(struct clk *); |
75 | extern void clk_pxa3xx_cken_disable(struct clk *); | |
7a2c5cb0 | 76 | |
aae8224d | 77 | extern struct sysdev_class pxa3xx_clock_sysclass; |
7a2c5cb0 | 78 | #endif |