ARM: pxa: introduce pxa2xx_clock_sysclass for clock suspend/resume
[deliverable/linux.git] / arch / arm / mach-pxa / clock.h
... / ...
CommitLineData
1#include <linux/sysdev.h>
2#include <asm/clkdev.h>
3
4struct clkops {
5 void (*enable)(struct clk *);
6 void (*disable)(struct clk *);
7 unsigned long (*getrate)(struct clk *);
8};
9
10struct clk {
11 const struct clkops *ops;
12 unsigned long rate;
13 unsigned int cken;
14 unsigned int delay;
15 unsigned int enabled;
16};
17
18void clk_dummy_enable(struct clk *);
19void clk_dummy_disable(struct clk *);
20
21extern const struct clkops clk_dummy_ops;
22extern struct clk clk_dummy;
23
24#define INIT_CLKREG(_clk,_devname,_conname) \
25 { \
26 .clk = _clk, \
27 .dev_id = _devname, \
28 .con_id = _conname, \
29 }
30
31#define DEFINE_CK(_name, _cken, _ops) \
32struct clk clk_##_name = { \
33 .ops = _ops, \
34 .cken = CKEN_##_cken, \
35 }
36
37#define DEFINE_CLK(_name, _ops, _rate, _delay) \
38struct clk clk_##_name = { \
39 .ops = _ops, \
40 .rate = _rate, \
41 .delay = _delay, \
42 }
43
44#define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \
45struct clk clk_##_name = { \
46 .ops = &clk_pxa2xx_cken_ops, \
47 .rate = _rate, \
48 .cken = CKEN_##_cken, \
49 .delay = _delay, \
50 }
51
52extern const struct clkops clk_pxa2xx_cken_ops;
53
54void clk_pxa2xx_cken_enable(struct clk *clk);
55void clk_pxa2xx_cken_disable(struct clk *clk);
56
57extern struct sysdev_class pxa2xx_clock_sysclass;
58
59#ifdef CONFIG_PXA3xx
60#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
61struct clk clk_##_name = { \
62 .ops = &clk_pxa3xx_cken_ops, \
63 .rate = _rate, \
64 .cken = CKEN_##_cken, \
65 .delay = _delay, \
66 }
67
68extern const struct clkops clk_pxa3xx_cken_ops;
69extern const struct clkops clk_pxa3xx_hsio_ops;
70extern const struct clkops clk_pxa3xx_ac97_ops;
71extern const struct clkops clk_pxa3xx_pout_ops;
72
73extern void clk_pxa3xx_cken_enable(struct clk *);
74extern void clk_pxa3xx_cken_disable(struct clk *);
75#endif
This page took 0.023004 seconds and 5 git commands to generate.