clocksource: mct: add support for mct clock setup
authorThomas Abraham <thomas.abraham@linaro.org>
Sat, 9 Mar 2013 08:10:37 +0000 (17:10 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 25 Mar 2013 09:17:14 +0000 (18:17 +0900)
Add support for mct clock lookup and setup to ensure that the mct
clock is has been turned on.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
drivers/clocksource/exynos_mct.c

index f817c540126984fa9ad922980f6b650ea63f6fc0..203ac05e2b3d9b4631dd5050f2cebfaf0d705d48 100644 (file)
@@ -479,7 +479,7 @@ static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
 
 static void __init exynos4_timer_resources(struct device_node *np)
 {
-       struct clk *tick_clk;
+       struct clk *mct_clk, *tick_clk;
 
        tick_clk = np ? of_clk_get_by_name(np, "fin_pll") :
                                clk_get(NULL, "fin_pll");
@@ -487,6 +487,11 @@ static void __init exynos4_timer_resources(struct device_node *np)
                panic("%s: unable to determine tick clock rate\n", __func__);
        clk_rate = clk_get_rate(tick_clk);
 
+       mct_clk = np ? of_clk_get_by_name(np, "mct") : clk_get(NULL, "mct");
+       if (IS_ERR(mct_clk))
+               panic("%s: unable to retrieve mct clock instance\n", __func__);
+       clk_prepare_enable(mct_clk);
+
        reg_base = np ? of_iomap(np, 0) : S5P_VA_SYSTIMER;
        if (!reg_base)
                panic("%s: unable to ioremap mct address space\n", __func__);