aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/exynos_mct.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/exynos_mct.c')
-rw-r--r--drivers/clocksource/exynos_mct.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 957af8636c9d..509a6019c96c 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -477,12 +477,20 @@ static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
477}; 477};
478#endif /* CONFIG_LOCAL_TIMERS */ 478#endif /* CONFIG_LOCAL_TIMERS */
479 479
480static void __init exynos4_timer_resources(void __iomem *base) 480static void __init exynos4_timer_resources(struct device_node *np, void __iomem *base)
481{ 481{
482 struct clk *mct_clk; 482 struct clk *mct_clk, *tick_clk;
483 mct_clk = clk_get(NULL, "xtal");
484 483
485 clk_rate = clk_get_rate(mct_clk); 484 tick_clk = np ? of_clk_get_by_name(np, "fin_pll") :
485 clk_get(NULL, "fin_pll");
486 if (IS_ERR(tick_clk))
487 panic("%s: unable to determine tick clock rate\n", __func__);
488 clk_rate = clk_get_rate(tick_clk);
489
490 mct_clk = np ? of_clk_get_by_name(np, "mct") : clk_get(NULL, "mct");
491 if (IS_ERR(mct_clk))
492 panic("%s: unable to retrieve mct clock instance\n", __func__);
493 clk_prepare_enable(mct_clk);
486 494
487 reg_base = base; 495 reg_base = base;
488 if (!reg_base) 496 if (!reg_base)
@@ -514,7 +522,7 @@ void __init mct_init(void)
514 panic("unable to determine mct controller type\n"); 522 panic("unable to determine mct controller type\n");
515 } 523 }
516 524
517 exynos4_timer_resources(S5P_VA_SYSTIMER); 525 exynos4_timer_resources(NULL, S5P_VA_SYSTIMER);
518 exynos4_clocksource_init(); 526 exynos4_clocksource_init();
519 exynos4_clockevent_init(); 527 exynos4_clockevent_init();
520} 528}
@@ -537,7 +545,7 @@ static void __init mct_init_dt(struct device_node *np, unsigned int int_type)
537 for (i = MCT_L0_IRQ; i < nr_irqs; i++) 545 for (i = MCT_L0_IRQ; i < nr_irqs; i++)
538 mct_irqs[i] = irq_of_parse_and_map(np, i); 546 mct_irqs[i] = irq_of_parse_and_map(np, i);
539 547
540 exynos4_timer_resources(of_iomap(np, 0)); 548 exynos4_timer_resources(np, of_iomap(np, 0));
541 exynos4_clocksource_init(); 549 exynos4_clocksource_init();
542 exynos4_clockevent_init(); 550 exynos4_clockevent_init();
543} 551}