diff options
-rw-r--r-- | arch/arm/mach-omap2/timer.c | 9 | ||||
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dmtimer.h | 19 |
3 files changed, 5 insertions, 24 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 19765bd96c8e..099e4060afe9 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -274,9 +274,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, | |||
274 | oh_name = name; | 274 | oh_name = name; |
275 | } | 275 | } |
276 | 276 | ||
277 | omap_hwmod_setup_one(oh_name); | ||
278 | oh = omap_hwmod_lookup(oh_name); | 277 | oh = omap_hwmod_lookup(oh_name); |
279 | |||
280 | if (!oh) | 278 | if (!oh) |
281 | return -ENODEV; | 279 | return -ENODEV; |
282 | 280 | ||
@@ -306,8 +304,6 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, | |||
306 | if (IS_ERR(timer->fclk)) | 304 | if (IS_ERR(timer->fclk)) |
307 | return -ENODEV; | 305 | return -ENODEV; |
308 | 306 | ||
309 | omap_hwmod_enable(oh); | ||
310 | |||
311 | /* FIXME: Need to remove hard-coded test on timer ID */ | 307 | /* FIXME: Need to remove hard-coded test on timer ID */ |
312 | if (gptimer_id != 12) { | 308 | if (gptimer_id != 12) { |
313 | struct clk *src; | 309 | struct clk *src; |
@@ -316,13 +312,16 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, | |||
316 | if (IS_ERR(src)) { | 312 | if (IS_ERR(src)) { |
317 | res = -EINVAL; | 313 | res = -EINVAL; |
318 | } else { | 314 | } else { |
319 | res = __omap_dm_timer_set_source(timer->fclk, src); | 315 | res = clk_set_parent(timer->fclk, src); |
320 | if (IS_ERR_VALUE(res)) | 316 | if (IS_ERR_VALUE(res)) |
321 | pr_warn("%s: %s cannot set source\n", | 317 | pr_warn("%s: %s cannot set source\n", |
322 | __func__, oh->name); | 318 | __func__, oh->name); |
323 | clk_put(src); | 319 | clk_put(src); |
324 | } | 320 | } |
325 | } | 321 | } |
322 | |||
323 | omap_hwmod_setup_one(oh_name); | ||
324 | omap_hwmod_enable(oh); | ||
326 | __omap_dm_timer_init_regs(timer); | 325 | __omap_dm_timer_init_regs(timer); |
327 | 326 | ||
328 | if (posted) | 327 | if (posted) |
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 305faf539465..9deeb3064d33 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -35,6 +35,7 @@ | |||
35 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 35 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include <linux/clk.h> | ||
38 | #include <linux/module.h> | 39 | #include <linux/module.h> |
39 | #include <linux/io.h> | 40 | #include <linux/io.h> |
40 | #include <linux/device.h> | 41 | #include <linux/device.h> |
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h index 769efb6f30d5..05a36e16f3f4 100644 --- a/arch/arm/plat-omap/include/plat/dmtimer.h +++ b/arch/arm/plat-omap/include/plat/dmtimer.h | |||
@@ -32,7 +32,6 @@ | |||
32 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 32 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/clk.h> | ||
36 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
37 | #include <linux/io.h> | 36 | #include <linux/io.h> |
38 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
@@ -397,24 +396,6 @@ static inline void __omap_dm_timer_override_errata(struct omap_dm_timer *timer, | |||
397 | timer->errata &= ~errata; | 396 | timer->errata &= ~errata; |
398 | } | 397 | } |
399 | 398 | ||
400 | static inline int __omap_dm_timer_set_source(struct clk *timer_fck, | ||
401 | struct clk *parent) | ||
402 | { | ||
403 | int ret; | ||
404 | |||
405 | clk_disable(timer_fck); | ||
406 | ret = clk_set_parent(timer_fck, parent); | ||
407 | clk_enable(timer_fck); | ||
408 | |||
409 | /* | ||
410 | * When the functional clock disappears, too quick writes seem | ||
411 | * to cause an abort. XXX Is this still necessary? | ||
412 | */ | ||
413 | __delay(300000); | ||
414 | |||
415 | return ret; | ||
416 | } | ||
417 | |||
418 | static inline void __omap_dm_timer_stop(struct omap_dm_timer *timer, | 399 | static inline void __omap_dm_timer_stop(struct omap_dm_timer *timer, |
419 | int posted, unsigned long rate) | 400 | int posted, unsigned long rate) |
420 | { | 401 | { |