diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 21:42:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 21:42:06 -0400 |
commit | b18cae4224bde7e5a332c19bc99247b2098ea232 (patch) | |
tree | 2ffa750e6a043a1dcfccd71588b7d6cfdcad440a /arch/arm/mach-tegra/clock.h | |
parent | 4833c16dea61cb30d6f77dfec3067a08ba79b361 (diff) | |
parent | f41649e040b1f63e809fb2adb78ed2f3c3ebbcd0 (diff) |
Merge branch 'for-next' of git://android.git.kernel.org/kernel/tegra
* 'for-next' of git://android.git.kernel.org/kernel/tegra:
spi: tegra: fix error setting on timeout
spi: add spi_tegra driver
tegra: harmony: enable PCI Express
tegra: add PCI Express support
tegra: add PCI Express clocks
[ARM] tegra: Add APB DMA support
[ARM] tegra: Add cpufreq support
[ARM] tegra: common: Update common clock init table
[ARM] tegra: clock: Add dvfs support, bug fixes, and cleanups
[ARM] tegra: Add support for reading fuses
[ARM] tegra: gpio: Add suspend and wake support
[ARM] tegra: pinmux: add safe values, move tegra2, add suspend
[ARM] tegra: add suspend and mirror irqs to legacy controller
[ARM] tegra: Add legacy irq support
[ARM] tegra: update iomap
Diffstat (limited to 'arch/arm/mach-tegra/clock.h')
-rw-r--r-- | arch/arm/mach-tegra/clock.h | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h index af7c70e2a3ba..94fd859770f1 100644 --- a/arch/arm/mach-tegra/clock.h +++ b/arch/arm/mach-tegra/clock.h | |||
@@ -27,18 +27,43 @@ | |||
27 | #define DIV_U71 (1 << 1) | 27 | #define DIV_U71 (1 << 1) |
28 | #define DIV_U71_FIXED (1 << 2) | 28 | #define DIV_U71_FIXED (1 << 2) |
29 | #define DIV_2 (1 << 3) | 29 | #define DIV_2 (1 << 3) |
30 | #define PLL_FIXED (1 << 4) | 30 | #define DIV_U16 (1 << 4) |
31 | #define PLL_HAS_CPCON (1 << 5) | 31 | #define PLL_FIXED (1 << 5) |
32 | #define MUX (1 << 6) | 32 | #define PLL_HAS_CPCON (1 << 6) |
33 | #define PLLD (1 << 7) | 33 | #define MUX (1 << 7) |
34 | #define PERIPH_NO_RESET (1 << 8) | 34 | #define PLLD (1 << 8) |
35 | #define PERIPH_NO_ENB (1 << 9) | 35 | #define PERIPH_NO_RESET (1 << 9) |
36 | #define PERIPH_EMC_ENB (1 << 10) | 36 | #define PERIPH_NO_ENB (1 << 10) |
37 | #define PERIPH_MANUAL_RESET (1 << 11) | 37 | #define PERIPH_EMC_ENB (1 << 11) |
38 | #define PLL_ALT_MISC_REG (1 << 12) | 38 | #define PERIPH_MANUAL_RESET (1 << 12) |
39 | #define PLL_ALT_MISC_REG (1 << 13) | ||
40 | #define PLLU (1 << 14) | ||
39 | #define ENABLE_ON_INIT (1 << 28) | 41 | #define ENABLE_ON_INIT (1 << 28) |
40 | 42 | ||
41 | struct clk; | 43 | struct clk; |
44 | struct regulator; | ||
45 | |||
46 | struct dvfs_table { | ||
47 | unsigned long rate; | ||
48 | int millivolts; | ||
49 | }; | ||
50 | |||
51 | struct dvfs_process_id_table { | ||
52 | int process_id; | ||
53 | struct dvfs_table *table; | ||
54 | }; | ||
55 | |||
56 | |||
57 | struct dvfs { | ||
58 | struct regulator *reg; | ||
59 | struct dvfs_table *table; | ||
60 | int max_millivolts; | ||
61 | |||
62 | int process_id_table_length; | ||
63 | const char *reg_id; | ||
64 | bool cpu; | ||
65 | struct dvfs_process_id_table process_id_table[]; | ||
66 | }; | ||
42 | 67 | ||
43 | struct clk_mux_sel { | 68 | struct clk_mux_sel { |
44 | struct clk *input; | 69 | struct clk *input; |
@@ -58,12 +83,9 @@ struct clk_ops { | |||
58 | void (*init)(struct clk *); | 83 | void (*init)(struct clk *); |
59 | int (*enable)(struct clk *); | 84 | int (*enable)(struct clk *); |
60 | void (*disable)(struct clk *); | 85 | void (*disable)(struct clk *); |
61 | void (*recalc)(struct clk *); | ||
62 | int (*set_parent)(struct clk *, struct clk *); | 86 | int (*set_parent)(struct clk *, struct clk *); |
63 | int (*set_rate)(struct clk *, unsigned long); | 87 | int (*set_rate)(struct clk *, unsigned long); |
64 | unsigned long (*get_rate)(struct clk *); | ||
65 | long (*round_rate)(struct clk *, unsigned long); | 88 | long (*round_rate)(struct clk *, unsigned long); |
66 | unsigned long (*recalculate_rate)(struct clk *); | ||
67 | }; | 89 | }; |
68 | 90 | ||
69 | enum clk_state { | 91 | enum clk_state { |
@@ -85,6 +107,7 @@ struct clk { | |||
85 | struct clk *parent; | 107 | struct clk *parent; |
86 | struct clk_lookup lookup; | 108 | struct clk_lookup lookup; |
87 | unsigned long rate; | 109 | unsigned long rate; |
110 | unsigned long max_rate; | ||
88 | u32 flags; | 111 | u32 flags; |
89 | u32 refcnt; | 112 | u32 refcnt; |
90 | const char *name; | 113 | const char *name; |
@@ -103,10 +126,6 @@ struct clk { | |||
103 | unsigned long cf_max; | 126 | unsigned long cf_max; |
104 | unsigned long vco_min; | 127 | unsigned long vco_min; |
105 | unsigned long vco_max; | 128 | unsigned long vco_max; |
106 | u32 m; | ||
107 | u32 n; | ||
108 | u32 p; | ||
109 | u32 cpcon; | ||
110 | const struct clk_pll_table *pll_table; | 129 | const struct clk_pll_table *pll_table; |
111 | 130 | ||
112 | /* DIV */ | 131 | /* DIV */ |
@@ -117,6 +136,12 @@ struct clk { | |||
117 | const struct clk_mux_sel *inputs; | 136 | const struct clk_mux_sel *inputs; |
118 | u32 sel; | 137 | u32 sel; |
119 | u32 reg_mask; | 138 | u32 reg_mask; |
139 | |||
140 | /* Virtual cpu clock */ | ||
141 | struct clk *main; | ||
142 | struct clk *backup; | ||
143 | |||
144 | struct dvfs *dvfs; | ||
120 | }; | 145 | }; |
121 | 146 | ||
122 | 147 | ||
@@ -141,6 +166,7 @@ unsigned long clk_measure_input_freq(void); | |||
141 | void clk_disable_locked(struct clk *c); | 166 | void clk_disable_locked(struct clk *c); |
142 | int clk_enable_locked(struct clk *c); | 167 | int clk_enable_locked(struct clk *c); |
143 | int clk_set_parent_locked(struct clk *c, struct clk *parent); | 168 | int clk_set_parent_locked(struct clk *c, struct clk *parent); |
169 | int clk_set_rate_locked(struct clk *c, unsigned long rate); | ||
144 | int clk_reparent(struct clk *c, struct clk *parent); | 170 | int clk_reparent(struct clk *c, struct clk *parent); |
145 | void tegra_clk_init_from_table(struct tegra_clk_init_table *table); | 171 | void tegra_clk_init_from_table(struct tegra_clk_init_table *table); |
146 | 172 | ||