imx: copy constants from mx3x.h to mx35.h using the appropriate namespace
[linux-2.6/x86.git] / arch / arm / mach-mmp / clock.h
blobed967e78e6a82eaa880c1ebf2db3a2ee9defde7a
1 /*
2 * linux/arch/arm/mach-mmp/clock.h
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
9 #include <asm/clkdev.h>
11 struct clkops {
12 void (*enable)(struct clk *);
13 void (*disable)(struct clk *);
14 unsigned long (*getrate)(struct clk *);
17 struct clk {
18 const struct clkops *ops;
20 void __iomem *clk_rst; /* clock reset control register */
21 int fnclksel; /* functional clock select (APBC) */
22 uint32_t enable_val; /* value for clock enable (APMU) */
23 unsigned long rate;
24 int enabled;
27 extern struct clkops apbc_clk_ops;
29 #define APBC_CLK(_name, _reg, _fnclksel, _rate) \
30 struct clk clk_##_name = { \
31 .clk_rst = (void __iomem *)APBC_##_reg, \
32 .fnclksel = _fnclksel, \
33 .rate = _rate, \
34 .ops = &apbc_clk_ops, \
37 #define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \
38 struct clk clk_##_name = { \
39 .clk_rst = (void __iomem *)APBC_##_reg, \
40 .fnclksel = _fnclksel, \
41 .rate = _rate, \
42 .ops = _ops, \
45 #define APMU_CLK(_name, _reg, _eval, _rate) \
46 struct clk clk_##_name = { \
47 .clk_rst = (void __iomem *)APMU_##_reg, \
48 .enable_val = _eval, \
49 .rate = _rate, \
50 .ops = &apmu_clk_ops, \
53 #define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \
54 struct clk clk_##_name = { \
55 .clk_rst = (void __iomem *)APMU_##_reg, \
56 .enable_val = _eval, \
57 .rate = _rate, \
58 .ops = _ops, \
61 #define INIT_CLKREG(_clk, _devname, _conname) \
62 { \
63 .clk = _clk, \
64 .dev_id = _devname, \
65 .con_id = _conname, \
68 extern struct clk clk_pxa168_gpio;
69 extern struct clk clk_pxa168_timers;
71 extern void clks_register(struct clk_lookup *, size_t);