Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
clock.h
Go to the documentation of this file.
1 #include <linux/clkdev.h>
2 #include <linux/syscore_ops.h>
3 
4 struct clkops {
5  void (*enable)(struct clk *);
6  void (*disable)(struct clk *);
7  unsigned long (*getrate)(struct clk *);
8  int (*setrate)(struct clk *, unsigned long);
9 };
10 
11 struct clk {
12  const struct clkops *ops;
13  unsigned long rate;
14  unsigned int cken;
15  unsigned int delay;
16  unsigned int enabled;
17 };
18 
19 void clk_dummy_enable(struct clk *);
20 void clk_dummy_disable(struct clk *);
21 
22 extern const struct clkops clk_dummy_ops;
23 extern struct clk clk_dummy;
24 
25 #define INIT_CLKREG(_clk,_devname,_conname) \
26  { \
27  .clk = _clk, \
28  .dev_id = _devname, \
29  .con_id = _conname, \
30  }
31 
32 #define DEFINE_CK(_name, _cken, _ops) \
33 struct clk clk_##_name = { \
34  .ops = _ops, \
35  .cken = CKEN_##_cken, \
36  }
37 
38 #define DEFINE_CLK(_name, _ops, _rate, _delay) \
39 struct clk clk_##_name = { \
40  .ops = _ops, \
41  .rate = _rate, \
42  .delay = _delay, \
43  }
44 
45 #define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \
46 struct clk clk_##_name = { \
47  .ops = &clk_pxa2xx_cken_ops, \
48  .rate = _rate, \
49  .cken = CKEN_##_cken, \
50  .delay = _delay, \
51  }
52 
53 extern const struct clkops clk_pxa2xx_cken_ops;
54 
55 void clk_pxa2xx_cken_enable(struct clk *clk);
56 void clk_pxa2xx_cken_disable(struct clk *clk);
57 
59 
60 #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x)
61 #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
62 struct clk clk_##_name = { \
63  .ops = &clk_pxa3xx_cken_ops, \
64  .rate = _rate, \
65  .cken = CKEN_##_cken, \
66  .delay = _delay, \
67  }
68 
69 extern const struct clkops clk_pxa3xx_cken_ops;
70 extern const struct clkops clk_pxa3xx_hsio_ops;
71 extern const struct clkops clk_pxa3xx_ac97_ops;
72 extern const struct clkops clk_pxa3xx_pout_ops;
73 extern const struct clkops clk_pxa3xx_smemc_ops;
74 
75 extern void clk_pxa3xx_cken_enable(struct clk *);
76 extern void clk_pxa3xx_cken_disable(struct clk *);
77 
79 
80 #endif