ARM: pxa: convert eseries to clock framework
[deliverable/linux.git] / arch / arm / mach-pxa / clock.h
CommitLineData
6d803ba7 1#include <linux/clkdev.h>
2eaa03b5 2#include <linux/syscore_ops.h>
a6dba20c
RK
3
4struct clkops {
5 void (*enable)(struct clk *);
6 void (*disable)(struct clk *);
7 unsigned long (*getrate)(struct clk *);
52585ccd 8 int (*setrate)(struct clk *, unsigned long);
a6dba20c
RK
9};
10
11struct clk {
a6dba20c
RK
12 const struct clkops *ops;
13 unsigned long rate;
14 unsigned int cken;
15 unsigned int delay;
16 unsigned int enabled;
17};
18
4029813c
EM
19void clk_dummy_enable(struct clk *);
20void clk_dummy_disable(struct clk *);
21
22extern const struct clkops clk_dummy_ops;
23extern struct clk clk_dummy;
24
8c3abc7d 25#define INIT_CLKREG(_clk,_devname,_conname) \
a6dba20c 26 { \
8c3abc7d
RK
27 .clk = _clk, \
28 .dev_id = _devname, \
29 .con_id = _conname, \
30 }
31
8c3abc7d
RK
32#define DEFINE_CK(_name, _cken, _ops) \
33struct clk clk_##_name = { \
a6dba20c
RK
34 .ops = _ops, \
35 .cken = CKEN_##_cken, \
36 }
37
8c3abc7d
RK
38#define DEFINE_CLK(_name, _ops, _rate, _delay) \
39struct clk clk_##_name = { \
40 .ops = _ops, \
41 .rate = _rate, \
ed847782
IM
42 .delay = _delay, \
43 }
44
4029813c 45#define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \
8c3abc7d 46struct clk clk_##_name = { \
4029813c 47 .ops = &clk_pxa2xx_cken_ops, \
7a2c5cb0 48 .rate = _rate, \
49 .cken = CKEN_##_cken, \
50 .delay = _delay, \
51 }
52
4029813c 53extern const struct clkops clk_pxa2xx_cken_ops;
a6dba20c 54
4029813c
EM
55void clk_pxa2xx_cken_enable(struct clk *clk);
56void clk_pxa2xx_cken_disable(struct clk *clk);
a6dba20c 57
2eaa03b5 58extern struct syscore_ops pxa2xx_clock_syscore_ops;
f113fe4e 59
49ea7fc0 60#if defined(CONFIG_PXA3xx)
8c3abc7d 61#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
8c3abc7d 62struct clk clk_##_name = { \
7a2c5cb0 63 .ops = &clk_pxa3xx_cken_ops, \
64 .rate = _rate, \
7a2c5cb0 65 .cken = CKEN_##_cken, \
7a2c5cb0 66 .delay = _delay, \
7a2c5cb0 67 }
68
69extern const struct clkops clk_pxa3xx_cken_ops;
4029813c
EM
70extern const struct clkops clk_pxa3xx_hsio_ops;
71extern const struct clkops clk_pxa3xx_ac97_ops;
72extern const struct clkops clk_pxa3xx_pout_ops;
c085052b 73extern const struct clkops clk_pxa3xx_smemc_ops;
4029813c 74
7a2c5cb0 75extern void clk_pxa3xx_cken_enable(struct clk *);
76extern void clk_pxa3xx_cken_disable(struct clk *);
7a2c5cb0 77
2eaa03b5
RW
78extern struct syscore_ops pxa3xx_clock_syscore_ops;
79
7a2c5cb0 80#endif
This page took 0.440238 seconds and 5 git commands to generate.