aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-11-04 09:02:46 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-02 09:52:18 -0500
commit548d849574847b788fe846fe21a41386063be161 (patch)
tree6c2ac7379c376793368affab03e5202abd0f1efa
parentdb8ac47cfccaafd3fa4c5c15320809d44f4fcef9 (diff)
[ARM] omap: introduce clock operations structure
Collect up all the common enable/disable clock operation functions into a separate operations structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-omap1/clock.c30
-rw-r--r--arch/arm/mach-omap1/clock.h152
-rw-r--r--arch/arm/mach-omap2/clock.c8
-rw-r--r--arch/arm/mach-omap2/clock24xx.c16
-rw-r--r--arch/arm/mach-omap2/clock24xx.h13
-rw-r--r--arch/arm/mach-omap2/clock34xx.c10
-rw-r--r--arch/arm/mach-omap2/clock34xx.h11
-rw-r--r--arch/arm/plat-omap/include/mach/clock.h8
8 files changed, 115 insertions, 133 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 5fba20731710..25ef04da6b06 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -26,8 +26,17 @@
26#include <mach/clock.h> 26#include <mach/clock.h>
27#include <mach/sram.h> 27#include <mach/sram.h>
28 28
29static const struct clkops clkops_generic;
30static const struct clkops clkops_uart;
31static const struct clkops clkops_dspck;
32
29#include "clock.h" 33#include "clock.h"
30 34
35static int omap1_clk_enable_generic(struct clk * clk);
36static int omap1_clk_enable(struct clk *clk);
37static void omap1_clk_disable_generic(struct clk * clk);
38static void omap1_clk_disable(struct clk *clk);
39
31__u32 arm_idlect1_mask; 40__u32 arm_idlect1_mask;
32 41
33/*------------------------------------------------------------------------- 42/*-------------------------------------------------------------------------
@@ -78,6 +87,11 @@ static void omap1_clk_disable_dsp_domain(struct clk *clk)
78 } 87 }
79} 88}
80 89
90static const struct clkops clkops_dspck = {
91 .enable = &omap1_clk_enable_dsp_domain,
92 .disable = &omap1_clk_disable_dsp_domain,
93};
94
81static int omap1_clk_enable_uart_functional(struct clk *clk) 95static int omap1_clk_enable_uart_functional(struct clk *clk)
82{ 96{
83 int ret; 97 int ret;
@@ -105,6 +119,11 @@ static void omap1_clk_disable_uart_functional(struct clk *clk)
105 omap1_clk_disable_generic(clk); 119 omap1_clk_disable_generic(clk);
106} 120}
107 121
122static const struct clkops clkops_uart = {
123 .enable = &omap1_clk_enable_uart_functional,
124 .disable = &omap1_clk_disable_uart_functional,
125};
126
108static void omap1_clk_allow_idle(struct clk *clk) 127static void omap1_clk_allow_idle(struct clk *clk)
109{ 128{
110 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk; 129 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk;
@@ -468,7 +487,7 @@ static int omap1_clk_enable(struct clk *clk)
468 omap1_clk_deny_idle(clk->parent); 487 omap1_clk_deny_idle(clk->parent);
469 } 488 }
470 489
471 ret = clk->enable(clk); 490 ret = clk->ops->enable(clk);
472 491
473 if (unlikely(ret != 0) && clk->parent) { 492 if (unlikely(ret != 0) && clk->parent) {
474 omap1_clk_disable(clk->parent); 493 omap1_clk_disable(clk->parent);
@@ -482,7 +501,7 @@ static int omap1_clk_enable(struct clk *clk)
482static void omap1_clk_disable(struct clk *clk) 501static void omap1_clk_disable(struct clk *clk)
483{ 502{
484 if (clk->usecount > 0 && !(--clk->usecount)) { 503 if (clk->usecount > 0 && !(--clk->usecount)) {
485 clk->disable(clk); 504 clk->ops->disable(clk);
486 if (likely(clk->parent)) { 505 if (likely(clk->parent)) {
487 omap1_clk_disable(clk->parent); 506 omap1_clk_disable(clk->parent);
488 if (clk->flags & CLOCK_NO_IDLE_PARENT) 507 if (clk->flags & CLOCK_NO_IDLE_PARENT)
@@ -561,6 +580,11 @@ static void omap1_clk_disable_generic(struct clk *clk)
561 } 580 }
562} 581}
563 582
583static const struct clkops clkops_generic = {
584 .enable = &omap1_clk_enable_generic,
585 .disable = &omap1_clk_disable_generic,
586};
587
564static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) 588static long omap1_clk_round_rate(struct clk *clk, unsigned long rate)
565{ 589{
566 int dsor_exp; 590 int dsor_exp;
@@ -659,7 +683,7 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
659 } 683 }
660 684
661 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name); 685 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name);
662 clk->disable(clk); 686 clk->ops->disable(clk);
663 printk(" done\n"); 687 printk(" done\n");
664} 688}
665 689
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index d4ccba464b4c..5b93a2a897ad 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -13,27 +13,19 @@
13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H 13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H
14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H 14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H
15 15
16static int omap1_clk_enable_generic(struct clk * clk);
17static void omap1_clk_disable_generic(struct clk * clk);
18static void omap1_ckctl_recalc(struct clk * clk); 16static void omap1_ckctl_recalc(struct clk * clk);
19static void omap1_watchdog_recalc(struct clk * clk); 17static void omap1_watchdog_recalc(struct clk * clk);
20static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); 18static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
21static void omap1_sossi_recalc(struct clk *clk); 19static void omap1_sossi_recalc(struct clk *clk);
22static void omap1_ckctl_recalc_dsp_domain(struct clk * clk); 20static void omap1_ckctl_recalc_dsp_domain(struct clk * clk);
23static int omap1_clk_enable_dsp_domain(struct clk * clk);
24static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); 21static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate);
25static void omap1_clk_disable_dsp_domain(struct clk * clk);
26static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); 22static int omap1_set_uart_rate(struct clk * clk, unsigned long rate);
27static void omap1_uart_recalc(struct clk * clk); 23static void omap1_uart_recalc(struct clk * clk);
28static int omap1_clk_enable_uart_functional(struct clk * clk);
29static void omap1_clk_disable_uart_functional(struct clk * clk);
30static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); 24static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate);
31static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); 25static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate);
32static void omap1_init_ext_clk(struct clk * clk); 26static void omap1_init_ext_clk(struct clk * clk);
33static int omap1_select_table_rate(struct clk * clk, unsigned long rate); 27static int omap1_select_table_rate(struct clk * clk, unsigned long rate);
34static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate); 28static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate);
35static int omap1_clk_enable(struct clk *clk);
36static void omap1_clk_disable(struct clk *clk);
37 29
38struct mpu_rate { 30struct mpu_rate {
39 unsigned long rate; 31 unsigned long rate;
@@ -152,39 +144,37 @@ static struct mpu_rate rate_table[] = {
152 144
153static struct clk ck_ref = { 145static struct clk ck_ref = {
154 .name = "ck_ref", 146 .name = "ck_ref",
147 .ops = &clkops_generic,
155 .rate = 12000000, 148 .rate = 12000000,
156 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 149 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
157 CLOCK_IN_OMAP310 | ALWAYS_ENABLED, 150 CLOCK_IN_OMAP310 | ALWAYS_ENABLED,
158 .enable = &omap1_clk_enable_generic,
159 .disable = &omap1_clk_disable_generic,
160}; 151};
161 152
162static struct clk ck_dpll1 = { 153static struct clk ck_dpll1 = {
163 .name = "ck_dpll1", 154 .name = "ck_dpll1",
155 .ops = &clkops_generic,
164 .parent = &ck_ref, 156 .parent = &ck_ref,
165 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 157 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
166 CLOCK_IN_OMAP310 | RATE_PROPAGATES | ALWAYS_ENABLED, 158 CLOCK_IN_OMAP310 | RATE_PROPAGATES | ALWAYS_ENABLED,
167 .enable = &omap1_clk_enable_generic,
168 .disable = &omap1_clk_disable_generic,
169}; 159};
170 160
171static struct arm_idlect1_clk ck_dpll1out = { 161static struct arm_idlect1_clk ck_dpll1out = {
172 .clk = { 162 .clk = {
173 .name = "ck_dpll1out", 163 .name = "ck_dpll1out",
164 .ops = &clkops_generic,
174 .parent = &ck_dpll1, 165 .parent = &ck_dpll1,
175 .flags = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL | 166 .flags = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL |
176 ENABLE_REG_32BIT | RATE_PROPAGATES, 167 ENABLE_REG_32BIT | RATE_PROPAGATES,
177 .enable_reg = (void __iomem *)ARM_IDLECT2, 168 .enable_reg = (void __iomem *)ARM_IDLECT2,
178 .enable_bit = EN_CKOUT_ARM, 169 .enable_bit = EN_CKOUT_ARM,
179 .recalc = &followparent_recalc, 170 .recalc = &followparent_recalc,
180 .enable = &omap1_clk_enable_generic,
181 .disable = &omap1_clk_disable_generic,
182 }, 171 },
183 .idlect_shift = 12, 172 .idlect_shift = 12,
184}; 173};
185 174
186static struct clk sossi_ck = { 175static struct clk sossi_ck = {
187 .name = "ck_sossi", 176 .name = "ck_sossi",
177 .ops = &clkops_generic,
188 .parent = &ck_dpll1out.clk, 178 .parent = &ck_dpll1out.clk,
189 .flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT | 179 .flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT |
190 ENABLE_REG_32BIT, 180 ENABLE_REG_32BIT,
@@ -192,25 +182,23 @@ static struct clk sossi_ck = {
192 .enable_bit = 16, 182 .enable_bit = 16,
193 .recalc = &omap1_sossi_recalc, 183 .recalc = &omap1_sossi_recalc,
194 .set_rate = &omap1_set_sossi_rate, 184 .set_rate = &omap1_set_sossi_rate,
195 .enable = &omap1_clk_enable_generic,
196 .disable = &omap1_clk_disable_generic,
197}; 185};
198 186
199static struct clk arm_ck = { 187static struct clk arm_ck = {
200 .name = "arm_ck", 188 .name = "arm_ck",
189 .ops = &clkops_generic,
201 .parent = &ck_dpll1, 190 .parent = &ck_dpll1,
202 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 191 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
203 CLOCK_IN_OMAP310 | RATE_CKCTL | RATE_PROPAGATES | 192 CLOCK_IN_OMAP310 | RATE_CKCTL | RATE_PROPAGATES |
204 ALWAYS_ENABLED, 193 ALWAYS_ENABLED,
205 .rate_offset = CKCTL_ARMDIV_OFFSET, 194 .rate_offset = CKCTL_ARMDIV_OFFSET,
206 .recalc = &omap1_ckctl_recalc, 195 .recalc = &omap1_ckctl_recalc,
207 .enable = &omap1_clk_enable_generic,
208 .disable = &omap1_clk_disable_generic,
209}; 196};
210 197
211static struct arm_idlect1_clk armper_ck = { 198static struct arm_idlect1_clk armper_ck = {
212 .clk = { 199 .clk = {
213 .name = "armper_ck", 200 .name = "armper_ck",
201 .ops = &clkops_generic,
214 .parent = &ck_dpll1, 202 .parent = &ck_dpll1,
215 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 203 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
216 CLOCK_IN_OMAP310 | RATE_CKCTL | 204 CLOCK_IN_OMAP310 | RATE_CKCTL |
@@ -219,34 +207,30 @@ static struct arm_idlect1_clk armper_ck = {
219 .enable_bit = EN_PERCK, 207 .enable_bit = EN_PERCK,
220 .rate_offset = CKCTL_PERDIV_OFFSET, 208 .rate_offset = CKCTL_PERDIV_OFFSET,
221 .recalc = &omap1_ckctl_recalc, 209 .recalc = &omap1_ckctl_recalc,
222 .enable = &omap1_clk_enable_generic,
223 .disable = &omap1_clk_disable_generic,
224 }, 210 },
225 .idlect_shift = 2, 211 .idlect_shift = 2,
226}; 212};
227 213
228static struct clk arm_gpio_ck = { 214static struct clk arm_gpio_ck = {
229 .name = "arm_gpio_ck", 215 .name = "arm_gpio_ck",
216 .ops = &clkops_generic,
230 .parent = &ck_dpll1, 217 .parent = &ck_dpll1,
231 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, 218 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310,
232 .enable_reg = (void __iomem *)ARM_IDLECT2, 219 .enable_reg = (void __iomem *)ARM_IDLECT2,
233 .enable_bit = EN_GPIOCK, 220 .enable_bit = EN_GPIOCK,
234 .recalc = &followparent_recalc, 221 .recalc = &followparent_recalc,
235 .enable = &omap1_clk_enable_generic,
236 .disable = &omap1_clk_disable_generic,
237}; 222};
238 223
239static struct arm_idlect1_clk armxor_ck = { 224static struct arm_idlect1_clk armxor_ck = {
240 .clk = { 225 .clk = {
241 .name = "armxor_ck", 226 .name = "armxor_ck",
227 .ops = &clkops_generic,
242 .parent = &ck_ref, 228 .parent = &ck_ref,
243 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 229 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
244 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 230 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL,
245 .enable_reg = (void __iomem *)ARM_IDLECT2, 231 .enable_reg = (void __iomem *)ARM_IDLECT2,
246 .enable_bit = EN_XORPCK, 232 .enable_bit = EN_XORPCK,
247 .recalc = &followparent_recalc, 233 .recalc = &followparent_recalc,
248 .enable = &omap1_clk_enable_generic,
249 .disable = &omap1_clk_disable_generic,
250 }, 234 },
251 .idlect_shift = 1, 235 .idlect_shift = 1,
252}; 236};
@@ -254,14 +238,13 @@ static struct arm_idlect1_clk armxor_ck = {
254static struct arm_idlect1_clk armtim_ck = { 238static struct arm_idlect1_clk armtim_ck = {
255 .clk = { 239 .clk = {
256 .name = "armtim_ck", 240 .name = "armtim_ck",
241 .ops = &clkops_generic,
257 .parent = &ck_ref, 242 .parent = &ck_ref,
258 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 243 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
259 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 244 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL,
260 .enable_reg = (void __iomem *)ARM_IDLECT2, 245 .enable_reg = (void __iomem *)ARM_IDLECT2,
261 .enable_bit = EN_TIMCK, 246 .enable_bit = EN_TIMCK,
262 .recalc = &followparent_recalc, 247 .recalc = &followparent_recalc,
263 .enable = &omap1_clk_enable_generic,
264 .disable = &omap1_clk_disable_generic,
265 }, 248 },
266 .idlect_shift = 9, 249 .idlect_shift = 9,
267}; 250};
@@ -269,20 +252,20 @@ static struct arm_idlect1_clk armtim_ck = {
269static struct arm_idlect1_clk armwdt_ck = { 252static struct arm_idlect1_clk armwdt_ck = {
270 .clk = { 253 .clk = {
271 .name = "armwdt_ck", 254 .name = "armwdt_ck",
255 .ops = &clkops_generic,
272 .parent = &ck_ref, 256 .parent = &ck_ref,
273 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 257 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
274 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 258 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL,
275 .enable_reg = (void __iomem *)ARM_IDLECT2, 259 .enable_reg = (void __iomem *)ARM_IDLECT2,
276 .enable_bit = EN_WDTCK, 260 .enable_bit = EN_WDTCK,
277 .recalc = &omap1_watchdog_recalc, 261 .recalc = &omap1_watchdog_recalc,
278 .enable = &omap1_clk_enable_generic,
279 .disable = &omap1_clk_disable_generic,
280 }, 262 },
281 .idlect_shift = 0, 263 .idlect_shift = 0,
282}; 264};
283 265
284static struct clk arminth_ck16xx = { 266static struct clk arminth_ck16xx = {
285 .name = "arminth_ck", 267 .name = "arminth_ck",
268 .ops = &clkops_generic,
286 .parent = &arm_ck, 269 .parent = &arm_ck,
287 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, 270 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
288 .recalc = &followparent_recalc, 271 .recalc = &followparent_recalc,
@@ -291,12 +274,11 @@ static struct clk arminth_ck16xx = {
291 * 274 *
292 * 1510 version is in TC clocks. 275 * 1510 version is in TC clocks.
293 */ 276 */
294 .enable = &omap1_clk_enable_generic,
295 .disable = &omap1_clk_disable_generic,
296}; 277};
297 278
298static struct clk dsp_ck = { 279static struct clk dsp_ck = {
299 .name = "dsp_ck", 280 .name = "dsp_ck",
281 .ops = &clkops_generic,
300 .parent = &ck_dpll1, 282 .parent = &ck_dpll1,
301 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 283 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
302 RATE_CKCTL, 284 RATE_CKCTL,
@@ -304,23 +286,21 @@ static struct clk dsp_ck = {
304 .enable_bit = EN_DSPCK, 286 .enable_bit = EN_DSPCK,
305 .rate_offset = CKCTL_DSPDIV_OFFSET, 287 .rate_offset = CKCTL_DSPDIV_OFFSET,
306 .recalc = &omap1_ckctl_recalc, 288 .recalc = &omap1_ckctl_recalc,
307 .enable = &omap1_clk_enable_generic,
308 .disable = &omap1_clk_disable_generic,
309}; 289};
310 290
311static struct clk dspmmu_ck = { 291static struct clk dspmmu_ck = {
312 .name = "dspmmu_ck", 292 .name = "dspmmu_ck",
293 .ops = &clkops_generic,
313 .parent = &ck_dpll1, 294 .parent = &ck_dpll1,
314 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 295 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
315 RATE_CKCTL | ALWAYS_ENABLED, 296 RATE_CKCTL | ALWAYS_ENABLED,
316 .rate_offset = CKCTL_DSPMMUDIV_OFFSET, 297 .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
317 .recalc = &omap1_ckctl_recalc, 298 .recalc = &omap1_ckctl_recalc,
318 .enable = &omap1_clk_enable_generic,
319 .disable = &omap1_clk_disable_generic,
320}; 299};
321 300
322static struct clk dspper_ck = { 301static struct clk dspper_ck = {
323 .name = "dspper_ck", 302 .name = "dspper_ck",
303 .ops = &clkops_dspck,
324 .parent = &ck_dpll1, 304 .parent = &ck_dpll1,
325 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 305 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
326 RATE_CKCTL | VIRTUAL_IO_ADDRESS, 306 RATE_CKCTL | VIRTUAL_IO_ADDRESS,
@@ -329,38 +309,35 @@ static struct clk dspper_ck = {
329 .rate_offset = CKCTL_PERDIV_OFFSET, 309 .rate_offset = CKCTL_PERDIV_OFFSET,
330 .recalc = &omap1_ckctl_recalc_dsp_domain, 310 .recalc = &omap1_ckctl_recalc_dsp_domain,
331 .set_rate = &omap1_clk_set_rate_dsp_domain, 311 .set_rate = &omap1_clk_set_rate_dsp_domain,
332 .enable = &omap1_clk_enable_dsp_domain,
333 .disable = &omap1_clk_disable_dsp_domain,
334}; 312};
335 313
336static struct clk dspxor_ck = { 314static struct clk dspxor_ck = {
337 .name = "dspxor_ck", 315 .name = "dspxor_ck",
316 .ops = &clkops_dspck,
338 .parent = &ck_ref, 317 .parent = &ck_ref,
339 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 318 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
340 VIRTUAL_IO_ADDRESS, 319 VIRTUAL_IO_ADDRESS,
341 .enable_reg = DSP_IDLECT2, 320 .enable_reg = DSP_IDLECT2,
342 .enable_bit = EN_XORPCK, 321 .enable_bit = EN_XORPCK,
343 .recalc = &followparent_recalc, 322 .recalc = &followparent_recalc,
344 .enable = &omap1_clk_enable_dsp_domain,
345 .disable = &omap1_clk_disable_dsp_domain,
346}; 323};
347 324
348static struct clk dsptim_ck = { 325static struct clk dsptim_ck = {
349 .name = "dsptim_ck", 326 .name = "dsptim_ck",
327 .ops = &clkops_dspck,
350 .parent = &ck_ref, 328 .parent = &ck_ref,
351 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 329 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
352 VIRTUAL_IO_ADDRESS, 330 VIRTUAL_IO_ADDRESS,
353 .enable_reg = DSP_IDLECT2, 331 .enable_reg = DSP_IDLECT2,
354 .enable_bit = EN_DSPTIMCK, 332 .enable_bit = EN_DSPTIMCK,
355 .recalc = &followparent_recalc, 333 .recalc = &followparent_recalc,
356 .enable = &omap1_clk_enable_dsp_domain,
357 .disable = &omap1_clk_disable_dsp_domain,
358}; 334};
359 335
360/* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */ 336/* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */
361static struct arm_idlect1_clk tc_ck = { 337static struct arm_idlect1_clk tc_ck = {
362 .clk = { 338 .clk = {
363 .name = "tc_ck", 339 .name = "tc_ck",
340 .ops = &clkops_generic,
364 .parent = &ck_dpll1, 341 .parent = &ck_dpll1,
365 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 342 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
366 CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 | 343 CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 |
@@ -368,14 +345,13 @@ static struct arm_idlect1_clk tc_ck = {
368 ALWAYS_ENABLED | CLOCK_IDLE_CONTROL, 345 ALWAYS_ENABLED | CLOCK_IDLE_CONTROL,
369 .rate_offset = CKCTL_TCDIV_OFFSET, 346 .rate_offset = CKCTL_TCDIV_OFFSET,
370 .recalc = &omap1_ckctl_recalc, 347 .recalc = &omap1_ckctl_recalc,
371 .enable = &omap1_clk_enable_generic,
372 .disable = &omap1_clk_disable_generic,
373 }, 348 },
374 .idlect_shift = 6, 349 .idlect_shift = 6,
375}; 350};
376 351
377static struct clk arminth_ck1510 = { 352static struct clk arminth_ck1510 = {
378 .name = "arminth_ck", 353 .name = "arminth_ck",
354 .ops = &clkops_generic,
379 .parent = &tc_ck.clk, 355 .parent = &tc_ck.clk,
380 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 356 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
381 ALWAYS_ENABLED, 357 ALWAYS_ENABLED,
@@ -384,86 +360,77 @@ static struct clk arminth_ck1510 = {
384 * 360 *
385 * 16xx version is in MPU clocks. 361 * 16xx version is in MPU clocks.
386 */ 362 */
387 .enable = &omap1_clk_enable_generic,
388 .disable = &omap1_clk_disable_generic,
389}; 363};
390 364
391static struct clk tipb_ck = { 365static struct clk tipb_ck = {
392 /* No-idle controlled by "tc_ck" */ 366 /* No-idle controlled by "tc_ck" */
393 .name = "tipb_ck", 367 .name = "tipb_ck",
368 .ops = &clkops_generic,
394 .parent = &tc_ck.clk, 369 .parent = &tc_ck.clk,
395 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 370 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
396 ALWAYS_ENABLED, 371 ALWAYS_ENABLED,
397 .recalc = &followparent_recalc, 372 .recalc = &followparent_recalc,
398 .enable = &omap1_clk_enable_generic,
399 .disable = &omap1_clk_disable_generic,
400}; 373};
401 374
402static struct clk l3_ocpi_ck = { 375static struct clk l3_ocpi_ck = {
403 /* No-idle controlled by "tc_ck" */ 376 /* No-idle controlled by "tc_ck" */
404 .name = "l3_ocpi_ck", 377 .name = "l3_ocpi_ck",
378 .ops = &clkops_generic,
405 .parent = &tc_ck.clk, 379 .parent = &tc_ck.clk,
406 .flags = CLOCK_IN_OMAP16XX, 380 .flags = CLOCK_IN_OMAP16XX,
407 .enable_reg = (void __iomem *)ARM_IDLECT3, 381 .enable_reg = (void __iomem *)ARM_IDLECT3,
408 .enable_bit = EN_OCPI_CK, 382 .enable_bit = EN_OCPI_CK,
409 .recalc = &followparent_recalc, 383 .recalc = &followparent_recalc,
410 .enable = &omap1_clk_enable_generic,
411 .disable = &omap1_clk_disable_generic,
412}; 384};
413 385
414static struct clk tc1_ck = { 386static struct clk tc1_ck = {
415 .name = "tc1_ck", 387 .name = "tc1_ck",
388 .ops = &clkops_generic,
416 .parent = &tc_ck.clk, 389 .parent = &tc_ck.clk,
417 .flags = CLOCK_IN_OMAP16XX, 390 .flags = CLOCK_IN_OMAP16XX,
418 .enable_reg = (void __iomem *)ARM_IDLECT3, 391 .enable_reg = (void __iomem *)ARM_IDLECT3,
419 .enable_bit = EN_TC1_CK, 392 .enable_bit = EN_TC1_CK,
420 .recalc = &followparent_recalc, 393 .recalc = &followparent_recalc,
421 .enable = &omap1_clk_enable_generic,
422 .disable = &omap1_clk_disable_generic,
423}; 394};
424 395
425static struct clk tc2_ck = { 396static struct clk tc2_ck = {
426 .name = "tc2_ck", 397 .name = "tc2_ck",
398 .ops = &clkops_generic,
427 .parent = &tc_ck.clk, 399 .parent = &tc_ck.clk,
428 .flags = CLOCK_IN_OMAP16XX, 400 .flags = CLOCK_IN_OMAP16XX,
429 .enable_reg = (void __iomem *)ARM_IDLECT3, 401 .enable_reg = (void __iomem *)ARM_IDLECT3,
430 .enable_bit = EN_TC2_CK, 402 .enable_bit = EN_TC2_CK,
431 .recalc = &followparent_recalc, 403 .recalc = &followparent_recalc,
432 .enable = &omap1_clk_enable_generic,
433 .disable = &omap1_clk_disable_generic,
434}; 404};
435 405
436static struct clk dma_ck = { 406static struct clk dma_ck = {
437 /* No-idle controlled by "tc_ck" */ 407 /* No-idle controlled by "tc_ck" */
438 .name = "dma_ck", 408 .name = "dma_ck",
409 .ops = &clkops_generic,
439 .parent = &tc_ck.clk, 410 .parent = &tc_ck.clk,
440 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 411 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
441 CLOCK_IN_OMAP310 | ALWAYS_ENABLED, 412 CLOCK_IN_OMAP310 | ALWAYS_ENABLED,
442 .recalc = &followparent_recalc, 413 .recalc = &followparent_recalc,
443 .enable = &omap1_clk_enable_generic,
444 .disable = &omap1_clk_disable_generic,
445}; 414};
446 415
447static struct clk dma_lcdfree_ck = { 416static struct clk dma_lcdfree_ck = {
448 .name = "dma_lcdfree_ck", 417 .name = "dma_lcdfree_ck",
418 .ops = &clkops_generic,
449 .parent = &tc_ck.clk, 419 .parent = &tc_ck.clk,
450 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, 420 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
451 .recalc = &followparent_recalc, 421 .recalc = &followparent_recalc,
452 .enable = &omap1_clk_enable_generic,
453 .disable = &omap1_clk_disable_generic,
454}; 422};
455 423
456static struct arm_idlect1_clk api_ck = { 424static struct arm_idlect1_clk api_ck = {
457 .clk = { 425 .clk = {
458 .name = "api_ck", 426 .name = "api_ck",
427 .ops = &clkops_generic,
459 .parent = &tc_ck.clk, 428 .parent = &tc_ck.clk,
460 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 429 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
461 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 430 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL,
462 .enable_reg = (void __iomem *)ARM_IDLECT2, 431 .enable_reg = (void __iomem *)ARM_IDLECT2,
463 .enable_bit = EN_APICK, 432 .enable_bit = EN_APICK,
464 .recalc = &followparent_recalc, 433 .recalc = &followparent_recalc,
465 .enable = &omap1_clk_enable_generic,
466 .disable = &omap1_clk_disable_generic,
467 }, 434 },
468 .idlect_shift = 8, 435 .idlect_shift = 8,
469}; 436};
@@ -471,51 +438,48 @@ static struct arm_idlect1_clk api_ck = {
471static struct arm_idlect1_clk lb_ck = { 438static struct arm_idlect1_clk lb_ck = {
472 .clk = { 439 .clk = {
473 .name = "lb_ck", 440 .name = "lb_ck",
441 .ops = &clkops_generic,
474 .parent = &tc_ck.clk, 442 .parent = &tc_ck.clk,
475 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 443 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
476 CLOCK_IDLE_CONTROL, 444 CLOCK_IDLE_CONTROL,
477 .enable_reg = (void __iomem *)ARM_IDLECT2, 445 .enable_reg = (void __iomem *)ARM_IDLECT2,
478 .enable_bit = EN_LBCK, 446 .enable_bit = EN_LBCK,
479 .recalc = &followparent_recalc, 447 .recalc = &followparent_recalc,
480 .enable = &omap1_clk_enable_generic,
481 .disable = &omap1_clk_disable_generic,
482 }, 448 },
483 .idlect_shift = 4, 449 .idlect_shift = 4,
484}; 450};
485 451
486static struct clk rhea1_ck = { 452static struct clk rhea1_ck = {
487 .name = "rhea1_ck", 453 .name = "rhea1_ck",
454 .ops = &clkops_generic,
488 .parent = &tc_ck.clk, 455 .parent = &tc_ck.clk,
489 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, 456 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
490 .recalc = &followparent_recalc, 457 .recalc = &followparent_recalc,
491 .enable = &omap1_clk_enable_generic,
492 .disable = &omap1_clk_disable_generic,
493}; 458};
494 459
495static struct clk rhea2_ck = { 460static struct clk rhea2_ck = {
496 .name = "rhea2_ck", 461 .name = "rhea2_ck",
462 .ops = &clkops_generic,
497 .parent = &tc_ck.clk, 463 .parent = &tc_ck.clk,
498 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, 464 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
499 .recalc = &followparent_recalc, 465 .recalc = &followparent_recalc,
500 .enable = &omap1_clk_enable_generic,
501 .disable = &omap1_clk_disable_generic,
502}; 466};
503 467
504static struct clk lcd_ck_16xx = { 468static struct clk lcd_ck_16xx = {
505 .name = "lcd_ck", 469 .name = "lcd_ck",
470 .ops = &clkops_generic,
506 .parent = &ck_dpll1, 471 .parent = &ck_dpll1,
507 .flags = CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 | RATE_CKCTL, 472 .flags = CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 | RATE_CKCTL,
508 .enable_reg = (void __iomem *)ARM_IDLECT2, 473 .enable_reg = (void __iomem *)ARM_IDLECT2,
509 .enable_bit = EN_LCDCK, 474 .enable_bit = EN_LCDCK,
510 .rate_offset = CKCTL_LCDDIV_OFFSET, 475 .rate_offset = CKCTL_LCDDIV_OFFSET,
511 .recalc = &omap1_ckctl_recalc, 476 .recalc = &omap1_ckctl_recalc,
512 .enable = &omap1_clk_enable_generic,
513 .disable = &omap1_clk_disable_generic,
514}; 477};
515 478
516static struct arm_idlect1_clk lcd_ck_1510 = { 479static struct arm_idlect1_clk lcd_ck_1510 = {
517 .clk = { 480 .clk = {
518 .name = "lcd_ck", 481 .name = "lcd_ck",
482 .ops = &clkops_generic,
519 .parent = &ck_dpll1, 483 .parent = &ck_dpll1,
520 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 484 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
521 RATE_CKCTL | CLOCK_IDLE_CONTROL, 485 RATE_CKCTL | CLOCK_IDLE_CONTROL,
@@ -523,14 +487,13 @@ static struct arm_idlect1_clk lcd_ck_1510 = {
523 .enable_bit = EN_LCDCK, 487 .enable_bit = EN_LCDCK,
524 .rate_offset = CKCTL_LCDDIV_OFFSET, 488 .rate_offset = CKCTL_LCDDIV_OFFSET,
525 .recalc = &omap1_ckctl_recalc, 489 .recalc = &omap1_ckctl_recalc,
526 .enable = &omap1_clk_enable_generic,
527 .disable = &omap1_clk_disable_generic,
528 }, 490 },
529 .idlect_shift = 3, 491 .idlect_shift = 3,
530}; 492};
531 493
532static struct clk uart1_1510 = { 494static struct clk uart1_1510 = {
533 .name = "uart1_ck", 495 .name = "uart1_ck",
496 .ops = &clkops_generic,
534 /* Direct from ULPD, no real parent */ 497 /* Direct from ULPD, no real parent */
535 .parent = &armper_ck.clk, 498 .parent = &armper_ck.clk,
536 .rate = 12000000, 499 .rate = 12000000,
@@ -541,13 +504,12 @@ static struct clk uart1_1510 = {
541 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */ 504 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */
542 .set_rate = &omap1_set_uart_rate, 505 .set_rate = &omap1_set_uart_rate,
543 .recalc = &omap1_uart_recalc, 506 .recalc = &omap1_uart_recalc,
544 .enable = &omap1_clk_enable_generic,
545 .disable = &omap1_clk_disable_generic,
546}; 507};
547 508
548static struct uart_clk uart1_16xx = { 509static struct uart_clk uart1_16xx = {
549 .clk = { 510 .clk = {
550 .name = "uart1_ck", 511 .name = "uart1_ck",
512 .ops = &clkops_uart,
551 /* Direct from ULPD, no real parent */ 513 /* Direct from ULPD, no real parent */
552 .parent = &armper_ck.clk, 514 .parent = &armper_ck.clk,
553 .rate = 48000000, 515 .rate = 48000000,
@@ -555,14 +517,13 @@ static struct uart_clk uart1_16xx = {
555 ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 517 ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
556 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 518 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
557 .enable_bit = 29, 519 .enable_bit = 29,
558 .enable = &omap1_clk_enable_uart_functional,
559 .disable = &omap1_clk_disable_uart_functional,
560 }, 520 },
561 .sysc_addr = 0xfffb0054, 521 .sysc_addr = 0xfffb0054,
562}; 522};
563 523
564static struct clk uart2_ck = { 524static struct clk uart2_ck = {
565 .name = "uart2_ck", 525 .name = "uart2_ck",
526 .ops = &clkops_generic,
566 /* Direct from ULPD, no real parent */ 527 /* Direct from ULPD, no real parent */
567 .parent = &armper_ck.clk, 528 .parent = &armper_ck.clk,
568 .rate = 12000000, 529 .rate = 12000000,
@@ -573,12 +534,11 @@ static struct clk uart2_ck = {
573 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */ 534 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */
574 .set_rate = &omap1_set_uart_rate, 535 .set_rate = &omap1_set_uart_rate,
575 .recalc = &omap1_uart_recalc, 536 .recalc = &omap1_uart_recalc,
576 .enable = &omap1_clk_enable_generic,
577 .disable = &omap1_clk_disable_generic,
578}; 537};
579 538
580static struct clk uart3_1510 = { 539static struct clk uart3_1510 = {
581 .name = "uart3_ck", 540 .name = "uart3_ck",
541 .ops = &clkops_generic,
582 /* Direct from ULPD, no real parent */ 542 /* Direct from ULPD, no real parent */
583 .parent = &armper_ck.clk, 543 .parent = &armper_ck.clk,
584 .rate = 12000000, 544 .rate = 12000000,
@@ -589,13 +549,12 @@ static struct clk uart3_1510 = {
589 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */ 549 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */
590 .set_rate = &omap1_set_uart_rate, 550 .set_rate = &omap1_set_uart_rate,
591 .recalc = &omap1_uart_recalc, 551 .recalc = &omap1_uart_recalc,
592 .enable = &omap1_clk_enable_generic,
593 .disable = &omap1_clk_disable_generic,
594}; 552};
595 553
596static struct uart_clk uart3_16xx = { 554static struct uart_clk uart3_16xx = {
597 .clk = { 555 .clk = {
598 .name = "uart3_ck", 556 .name = "uart3_ck",
557 .ops = &clkops_uart,
599 /* Direct from ULPD, no real parent */ 558 /* Direct from ULPD, no real parent */
600 .parent = &armper_ck.clk, 559 .parent = &armper_ck.clk,
601 .rate = 48000000, 560 .rate = 48000000,
@@ -603,38 +562,35 @@ static struct uart_clk uart3_16xx = {
603 ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 562 ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
604 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 563 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
605 .enable_bit = 31, 564 .enable_bit = 31,
606 .enable = &omap1_clk_enable_uart_functional,
607 .disable = &omap1_clk_disable_uart_functional,
608 }, 565 },
609 .sysc_addr = 0xfffb9854, 566 .sysc_addr = 0xfffb9854,
610}; 567};
611 568
612static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */ 569static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
613 .name = "usb_clko", 570 .name = "usb_clko",
571 .ops = &clkops_generic,
614 /* Direct from ULPD, no parent */ 572 /* Direct from ULPD, no parent */
615 .rate = 6000000, 573 .rate = 6000000,
616 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 574 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
617 CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT, 575 CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT,
618 .enable_reg = (void __iomem *)ULPD_CLOCK_CTRL, 576 .enable_reg = (void __iomem *)ULPD_CLOCK_CTRL,
619 .enable_bit = USB_MCLK_EN_BIT, 577 .enable_bit = USB_MCLK_EN_BIT,
620 .enable = &omap1_clk_enable_generic,
621 .disable = &omap1_clk_disable_generic,
622}; 578};
623 579
624static struct clk usb_hhc_ck1510 = { 580static struct clk usb_hhc_ck1510 = {
625 .name = "usb_hhc_ck", 581 .name = "usb_hhc_ck",
582 .ops = &clkops_generic,
626 /* Direct from ULPD, no parent */ 583 /* Direct from ULPD, no parent */
627 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ 584 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
628 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 585 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
629 RATE_FIXED | ENABLE_REG_32BIT, 586 RATE_FIXED | ENABLE_REG_32BIT,
630 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 587 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
631 .enable_bit = USB_HOST_HHC_UHOST_EN, 588 .enable_bit = USB_HOST_HHC_UHOST_EN,
632 .enable = &omap1_clk_enable_generic,
633 .disable = &omap1_clk_disable_generic,
634}; 589};
635 590
636static struct clk usb_hhc_ck16xx = { 591static struct clk usb_hhc_ck16xx = {
637 .name = "usb_hhc_ck", 592 .name = "usb_hhc_ck",
593 .ops = &clkops_generic,
638 /* Direct from ULPD, no parent */ 594 /* Direct from ULPD, no parent */
639 .rate = 48000000, 595 .rate = 48000000,
640 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */ 596 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
@@ -642,34 +598,31 @@ static struct clk usb_hhc_ck16xx = {
642 RATE_FIXED | ENABLE_REG_32BIT, 598 RATE_FIXED | ENABLE_REG_32BIT,
643 .enable_reg = (void __iomem *)OTG_BASE + 0x08 /* OTG_SYSCON_2 */, 599 .enable_reg = (void __iomem *)OTG_BASE + 0x08 /* OTG_SYSCON_2 */,
644 .enable_bit = 8 /* UHOST_EN */, 600 .enable_bit = 8 /* UHOST_EN */,
645 .enable = &omap1_clk_enable_generic,
646 .disable = &omap1_clk_disable_generic,
647}; 601};
648 602
649static struct clk usb_dc_ck = { 603static struct clk usb_dc_ck = {
650 .name = "usb_dc_ck", 604 .name = "usb_dc_ck",
605 .ops = &clkops_generic,
651 /* Direct from ULPD, no parent */ 606 /* Direct from ULPD, no parent */
652 .rate = 48000000, 607 .rate = 48000000,
653 .flags = CLOCK_IN_OMAP16XX | RATE_FIXED, 608 .flags = CLOCK_IN_OMAP16XX | RATE_FIXED,
654 .enable_reg = (void __iomem *)SOFT_REQ_REG, 609 .enable_reg = (void __iomem *)SOFT_REQ_REG,
655 .enable_bit = 4, 610 .enable_bit = 4,
656 .enable = &omap1_clk_enable_generic,
657 .disable = &omap1_clk_disable_generic,
658}; 611};
659 612
660static struct clk mclk_1510 = { 613static struct clk mclk_1510 = {
661 .name = "mclk", 614 .name = "mclk",
615 .ops = &clkops_generic,
662 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 616 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
663 .rate = 12000000, 617 .rate = 12000000,
664 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, 618 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED,
665 .enable_reg = (void __iomem *)SOFT_REQ_REG, 619 .enable_reg = (void __iomem *)SOFT_REQ_REG,
666 .enable_bit = 6, 620 .enable_bit = 6,
667 .enable = &omap1_clk_enable_generic,
668 .disable = &omap1_clk_disable_generic,
669}; 621};
670 622
671static struct clk mclk_16xx = { 623static struct clk mclk_16xx = {
672 .name = "mclk", 624 .name = "mclk",
625 .ops = &clkops_generic,
673 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 626 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
674 .flags = CLOCK_IN_OMAP16XX, 627 .flags = CLOCK_IN_OMAP16XX,
675 .enable_reg = (void __iomem *)COM_CLK_DIV_CTRL_SEL, 628 .enable_reg = (void __iomem *)COM_CLK_DIV_CTRL_SEL,
@@ -677,21 +630,19 @@ static struct clk mclk_16xx = {
677 .set_rate = &omap1_set_ext_clk_rate, 630 .set_rate = &omap1_set_ext_clk_rate,
678 .round_rate = &omap1_round_ext_clk_rate, 631 .round_rate = &omap1_round_ext_clk_rate,
679 .init = &omap1_init_ext_clk, 632 .init = &omap1_init_ext_clk,
680 .enable = &omap1_clk_enable_generic,
681 .disable = &omap1_clk_disable_generic,
682}; 633};
683 634
684static struct clk bclk_1510 = { 635static struct clk bclk_1510 = {
685 .name = "bclk", 636 .name = "bclk",
637 .ops = &clkops_generic,
686 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 638 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
687 .rate = 12000000, 639 .rate = 12000000,
688 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, 640 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED,
689 .enable = &omap1_clk_enable_generic,
690 .disable = &omap1_clk_disable_generic,
691}; 641};
692 642
693static struct clk bclk_16xx = { 643static struct clk bclk_16xx = {
694 .name = "bclk", 644 .name = "bclk",
645 .ops = &clkops_generic,
695 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 646 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
696 .flags = CLOCK_IN_OMAP16XX, 647 .flags = CLOCK_IN_OMAP16XX,
697 .enable_reg = (void __iomem *)SWD_CLK_DIV_CTRL_SEL, 648 .enable_reg = (void __iomem *)SWD_CLK_DIV_CTRL_SEL,
@@ -699,12 +650,11 @@ static struct clk bclk_16xx = {
699 .set_rate = &omap1_set_ext_clk_rate, 650 .set_rate = &omap1_set_ext_clk_rate,
700 .round_rate = &omap1_round_ext_clk_rate, 651 .round_rate = &omap1_round_ext_clk_rate,
701 .init = &omap1_init_ext_clk, 652 .init = &omap1_init_ext_clk,
702 .enable = &omap1_clk_enable_generic,
703 .disable = &omap1_clk_disable_generic,
704}; 653};
705 654
706static struct clk mmc1_ck = { 655static struct clk mmc1_ck = {
707 .name = "mmc_ck", 656 .name = "mmc_ck",
657 .ops = &clkops_generic,
708 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 658 /* Functional clock is direct from ULPD, interface clock is ARMPER */
709 .parent = &armper_ck.clk, 659 .parent = &armper_ck.clk,
710 .rate = 48000000, 660 .rate = 48000000,
@@ -713,13 +663,12 @@ static struct clk mmc1_ck = {
713 CLOCK_NO_IDLE_PARENT, 663 CLOCK_NO_IDLE_PARENT,
714 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 664 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
715 .enable_bit = 23, 665 .enable_bit = 23,
716 .enable = &omap1_clk_enable_generic,
717 .disable = &omap1_clk_disable_generic,
718}; 666};
719 667
720static struct clk mmc2_ck = { 668static struct clk mmc2_ck = {
721 .name = "mmc_ck", 669 .name = "mmc_ck",
722 .id = 1, 670 .id = 1,
671 .ops = &clkops_generic,
723 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 672 /* Functional clock is direct from ULPD, interface clock is ARMPER */
724 .parent = &armper_ck.clk, 673 .parent = &armper_ck.clk,
725 .rate = 48000000, 674 .rate = 48000000,
@@ -727,20 +676,17 @@ static struct clk mmc2_ck = {
727 RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 676 RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
728 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 677 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
729 .enable_bit = 20, 678 .enable_bit = 20,
730 .enable = &omap1_clk_enable_generic,
731 .disable = &omap1_clk_disable_generic,
732}; 679};
733 680
734static struct clk virtual_ck_mpu = { 681static struct clk virtual_ck_mpu = {
735 .name = "mpu", 682 .name = "mpu",
683 .ops = &clkops_generic,
736 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 684 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
737 CLOCK_IN_OMAP310 | ALWAYS_ENABLED, 685 CLOCK_IN_OMAP310 | ALWAYS_ENABLED,
738 .parent = &arm_ck, /* Is smarter alias for */ 686 .parent = &arm_ck, /* Is smarter alias for */
739 .recalc = &followparent_recalc, 687 .recalc = &followparent_recalc,
740 .set_rate = &omap1_select_table_rate, 688 .set_rate = &omap1_select_table_rate,
741 .round_rate = &omap1_round_to_table_rate, 689 .round_rate = &omap1_round_to_table_rate,
742 .enable = &omap1_clk_enable_generic,
743 .disable = &omap1_clk_disable_generic,
744}; 690};
745 691
746/* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK 692/* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK
@@ -748,23 +694,21 @@ remains active during MPU idle whenever this is enabled */
748static struct clk i2c_fck = { 694static struct clk i2c_fck = {
749 .name = "i2c_fck", 695 .name = "i2c_fck",
750 .id = 1, 696 .id = 1,
697 .ops = &clkops_generic,
751 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 698 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
752 CLOCK_NO_IDLE_PARENT | ALWAYS_ENABLED, 699 CLOCK_NO_IDLE_PARENT | ALWAYS_ENABLED,
753 .parent = &armxor_ck.clk, 700 .parent = &armxor_ck.clk,
754 .recalc = &followparent_recalc, 701 .recalc = &followparent_recalc,
755 .enable = &omap1_clk_enable_generic,
756 .disable = &omap1_clk_disable_generic,
757}; 702};
758 703
759static struct clk i2c_ick = { 704static struct clk i2c_ick = {
760 .name = "i2c_ick", 705 .name = "i2c_ick",
761 .id = 1, 706 .id = 1,
707 .ops = &clkops_generic,
762 .flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT | 708 .flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT |
763 ALWAYS_ENABLED, 709 ALWAYS_ENABLED,
764 .parent = &armper_ck.clk, 710 .parent = &armper_ck.clk,
765 .recalc = &followparent_recalc, 711 .recalc = &followparent_recalc,
766 .enable = &omap1_clk_enable_generic,
767 .disable = &omap1_clk_disable_generic,
768}; 712};
769 713
770static struct clk * onchip_clks[] = { 714static struct clk * onchip_clks[] = {
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index ad721e0cbf7a..d3213f565d5f 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -274,8 +274,8 @@ int _omap2_clk_enable(struct clk *clk)
274 if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK)) 274 if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
275 return 0; 275 return 0;
276 276
277 if (clk->enable) 277 if (clk->ops && clk->ops->enable)
278 return clk->enable(clk); 278 return clk->ops->enable(clk);
279 279
280 if (unlikely(clk->enable_reg == NULL)) { 280 if (unlikely(clk->enable_reg == NULL)) {
281 printk(KERN_ERR "clock.c: Enable for %s without enable code\n", 281 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
@@ -304,8 +304,8 @@ void _omap2_clk_disable(struct clk *clk)
304 if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK)) 304 if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
305 return; 305 return;
306 306
307 if (clk->disable) { 307 if (clk->ops && clk->ops->disable) {
308 clk->disable(clk); 308 clk->ops->disable(clk);
309 return; 309 return;
310 } 310 }
311 311
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index d382eb0184ac..866a618c4d8d 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -34,12 +34,16 @@
34 34
35#include "memory.h" 35#include "memory.h"
36#include "clock.h" 36#include "clock.h"
37#include "clock24xx.h"
38#include "prm.h" 37#include "prm.h"
39#include "prm-regbits-24xx.h" 38#include "prm-regbits-24xx.h"
40#include "cm.h" 39#include "cm.h"
41#include "cm-regbits-24xx.h" 40#include "cm-regbits-24xx.h"
42 41
42static const struct clkops clkops_oscck;
43static const struct clkops clkops_fixed;
44
45#include "clock24xx.h"
46
43/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ 47/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
44#define EN_APLL_STOPPED 0 48#define EN_APLL_STOPPED 0
45#define EN_APLL_LOCKED 3 49#define EN_APLL_LOCKED 3
@@ -96,6 +100,11 @@ static void omap2_disable_osc_ck(struct clk *clk)
96 OMAP24XX_PRCM_CLKSRC_CTRL); 100 OMAP24XX_PRCM_CLKSRC_CTRL);
97} 101}
98 102
103static const struct clkops clkops_oscck = {
104 .enable = &omap2_enable_osc_ck,
105 .disable = &omap2_disable_osc_ck,
106};
107
99#ifdef OLD_CK 108#ifdef OLD_CK
100/* Recalculate SYST_CLK */ 109/* Recalculate SYST_CLK */
101static void omap2_sys_clk_recalc(struct clk * clk) 110static void omap2_sys_clk_recalc(struct clk * clk)
@@ -149,6 +158,11 @@ static void omap2_clk_fixed_disable(struct clk *clk)
149 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 158 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
150} 159}
151 160
161static const struct clkops clkops_fixed = {
162 .enable = &omap2_clk_fixed_enable,
163 .disable = &omap2_clk_fixed_disable,
164};
165
152/* 166/*
153 * Uses the current prcm set to tell if a rate is valid. 167 * Uses the current prcm set to tell if a rate is valid.
154 * You can go slower, but not faster within a given rate set. 168 * You can go slower, but not faster within a given rate set.
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index 8c57a2e180f6..2aa0b5e65608 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -31,10 +31,6 @@ static void omap2_sys_clk_recalc(struct clk *clk);
31static void omap2_osc_clk_recalc(struct clk *clk); 31static void omap2_osc_clk_recalc(struct clk *clk);
32static void omap2_sys_clk_recalc(struct clk *clk); 32static void omap2_sys_clk_recalc(struct clk *clk);
33static void omap2_dpllcore_recalc(struct clk *clk); 33static void omap2_dpllcore_recalc(struct clk *clk);
34static int omap2_clk_fixed_enable(struct clk *clk);
35static void omap2_clk_fixed_disable(struct clk *clk);
36static int omap2_enable_osc_ck(struct clk *clk);
37static void omap2_disable_osc_ck(struct clk *clk);
38static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); 34static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate);
39 35
40/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 36/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
@@ -633,11 +629,10 @@ static struct clk func_32k_ck = {
633/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ 629/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
634static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ 630static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
635 .name = "osc_ck", 631 .name = "osc_ck",
632 .ops = &clkops_oscck,
636 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 633 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
637 RATE_PROPAGATES, 634 RATE_PROPAGATES,
638 .clkdm_name = "wkup_clkdm", 635 .clkdm_name = "wkup_clkdm",
639 .enable = &omap2_enable_osc_ck,
640 .disable = &omap2_disable_osc_ck,
641 .recalc = &omap2_osc_clk_recalc, 636 .recalc = &omap2_osc_clk_recalc,
642}; 637};
643 638
@@ -695,6 +690,7 @@ static struct clk dpll_ck = {
695 690
696static struct clk apll96_ck = { 691static struct clk apll96_ck = {
697 .name = "apll96_ck", 692 .name = "apll96_ck",
693 .ops = &clkops_fixed,
698 .parent = &sys_ck, 694 .parent = &sys_ck,
699 .rate = 96000000, 695 .rate = 96000000,
700 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 696 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
@@ -702,13 +698,12 @@ static struct clk apll96_ck = {
702 .clkdm_name = "wkup_clkdm", 698 .clkdm_name = "wkup_clkdm",
703 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 699 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
704 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, 700 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
705 .enable = &omap2_clk_fixed_enable,
706 .disable = &omap2_clk_fixed_disable,
707 .recalc = &propagate_rate, 701 .recalc = &propagate_rate,
708}; 702};
709 703
710static struct clk apll54_ck = { 704static struct clk apll54_ck = {
711 .name = "apll54_ck", 705 .name = "apll54_ck",
706 .ops = &clkops_fixed,
712 .parent = &sys_ck, 707 .parent = &sys_ck,
713 .rate = 54000000, 708 .rate = 54000000,
714 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 709 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
@@ -716,8 +711,6 @@ static struct clk apll54_ck = {
716 .clkdm_name = "wkup_clkdm", 711 .clkdm_name = "wkup_clkdm",
717 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 712 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
718 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, 713 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
719 .enable = &omap2_clk_fixed_enable,
720 .disable = &omap2_clk_fixed_disable,
721 .recalc = &propagate_rate, 714 .recalc = &propagate_rate,
722}; 715};
723 716
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 31bb7010bd48..2f2d43db2dd8 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -33,12 +33,15 @@
33 33
34#include "memory.h" 34#include "memory.h"
35#include "clock.h" 35#include "clock.h"
36#include "clock34xx.h"
37#include "prm.h" 36#include "prm.h"
38#include "prm-regbits-34xx.h" 37#include "prm-regbits-34xx.h"
39#include "cm.h" 38#include "cm.h"
40#include "cm-regbits-34xx.h" 39#include "cm-regbits-34xx.h"
41 40
41static const struct clkops clkops_noncore_dpll_ops;
42
43#include "clock34xx.h"
44
42/* CM_AUTOIDLE_PLL*.AUTO_* bit values */ 45/* CM_AUTOIDLE_PLL*.AUTO_* bit values */
43#define DPLL_AUTOIDLE_DISABLE 0x0 46#define DPLL_AUTOIDLE_DISABLE 0x0
44#define DPLL_AUTOIDLE_LOW_POWER_STOP 0x1 47#define DPLL_AUTOIDLE_LOW_POWER_STOP 0x1
@@ -270,6 +273,11 @@ static void omap3_noncore_dpll_disable(struct clk *clk)
270 _omap3_noncore_dpll_stop(clk); 273 _omap3_noncore_dpll_stop(clk);
271} 274}
272 275
276static const struct clkops clkops_noncore_dpll_ops = {
277 .enable = &omap3_noncore_dpll_enable,
278 .disable = &omap3_noncore_dpll_disable,
279};
280
273/** 281/**
274 * omap3_dpll_autoidle_read - read a DPLL's autoidle bits 282 * omap3_dpll_autoidle_read - read a DPLL's autoidle bits
275 * @clk: struct clk * of the DPLL to read 283 * @clk: struct clk * of the DPLL to read
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index a826094d89b5..8b188fb9beab 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -32,8 +32,6 @@ static void omap3_clkoutx2_recalc(struct clk *clk);
32static void omap3_dpll_allow_idle(struct clk *clk); 32static void omap3_dpll_allow_idle(struct clk *clk);
33static void omap3_dpll_deny_idle(struct clk *clk); 33static void omap3_dpll_deny_idle(struct clk *clk);
34static u32 omap3_dpll_autoidle_read(struct clk *clk); 34static u32 omap3_dpll_autoidle_read(struct clk *clk);
35static int omap3_noncore_dpll_enable(struct clk *clk);
36static void omap3_noncore_dpll_disable(struct clk *clk);
37 35
38/* Maximum DPLL multiplier, divider values for OMAP3 */ 36/* Maximum DPLL multiplier, divider values for OMAP3 */
39#define OMAP3_MAX_DPLL_MULT 2048 37#define OMAP3_MAX_DPLL_MULT 2048
@@ -347,11 +345,10 @@ static struct dpll_data dpll2_dd = {
347 345
348static struct clk dpll2_ck = { 346static struct clk dpll2_ck = {
349 .name = "dpll2_ck", 347 .name = "dpll2_ck",
348 .ops = &clkops_noncore_dpll_ops,
350 .parent = &sys_ck, 349 .parent = &sys_ck,
351 .dpll_data = &dpll2_dd, 350 .dpll_data = &dpll2_dd,
352 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, 351 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
353 .enable = &omap3_noncore_dpll_enable,
354 .disable = &omap3_noncore_dpll_disable,
355 .round_rate = &omap2_dpll_round_rate, 352 .round_rate = &omap2_dpll_round_rate,
356 .recalc = &omap3_dpll_recalc, 353 .recalc = &omap3_dpll_recalc,
357}; 354};
@@ -582,11 +579,10 @@ static struct dpll_data dpll4_dd = {
582 579
583static struct clk dpll4_ck = { 580static struct clk dpll4_ck = {
584 .name = "dpll4_ck", 581 .name = "dpll4_ck",
582 .ops = &clkops_noncore_dpll_ops,
585 .parent = &sys_ck, 583 .parent = &sys_ck,
586 .dpll_data = &dpll4_dd, 584 .dpll_data = &dpll4_dd,
587 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, 585 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
588 .enable = &omap3_noncore_dpll_enable,
589 .disable = &omap3_noncore_dpll_disable,
590 .round_rate = &omap2_dpll_round_rate, 586 .round_rate = &omap2_dpll_round_rate,
591 .recalc = &omap3_dpll_recalc, 587 .recalc = &omap3_dpll_recalc,
592}; 588};
@@ -884,11 +880,10 @@ static struct dpll_data dpll5_dd = {
884 880
885static struct clk dpll5_ck = { 881static struct clk dpll5_ck = {
886 .name = "dpll5_ck", 882 .name = "dpll5_ck",
883 .ops = &clkops_noncore_dpll_ops,
887 .parent = &sys_ck, 884 .parent = &sys_ck,
888 .dpll_data = &dpll5_dd, 885 .dpll_data = &dpll5_dd,
889 .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES, 886 .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES,
890 .enable = &omap3_noncore_dpll_enable,
891 .disable = &omap3_noncore_dpll_disable,
892 .round_rate = &omap2_dpll_round_rate, 887 .round_rate = &omap2_dpll_round_rate,
893 .recalc = &omap3_dpll_recalc, 888 .recalc = &omap3_dpll_recalc,
894}; 889};
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h
index 4e8f59df30bd..4fe5084e8cc2 100644
--- a/arch/arm/plat-omap/include/mach/clock.h
+++ b/arch/arm/plat-omap/include/mach/clock.h
@@ -17,6 +17,11 @@ struct module;
17struct clk; 17struct clk;
18struct clockdomain; 18struct clockdomain;
19 19
20struct clkops {
21 int (*enable)(struct clk *);
22 void (*disable)(struct clk *);
23};
24
20#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 25#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
21 26
22struct clksel_rate { 27struct clksel_rate {
@@ -59,6 +64,7 @@ struct dpll_data {
59 64
60struct clk { 65struct clk {
61 struct list_head node; 66 struct list_head node;
67 const struct clkops *ops;
62 struct module *owner; 68 struct module *owner;
63 const char *name; 69 const char *name;
64 int id; 70 int id;
@@ -72,8 +78,6 @@ struct clk {
72 int (*set_rate)(struct clk *, unsigned long); 78 int (*set_rate)(struct clk *, unsigned long);
73 long (*round_rate)(struct clk *, unsigned long); 79 long (*round_rate)(struct clk *, unsigned long);
74 void (*init)(struct clk *); 80 void (*init)(struct clk *);
75 int (*enable)(struct clk *);
76 void (*disable)(struct clk *);
77#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 81#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
78 u8 fixed_div; 82 u8 fixed_div;
79 void __iomem *clksel_reg; 83 void __iomem *clksel_reg;