Revert "ARM: smp_twd: convert to use CLKSRC_OF init"
Dan Willemsen [Tue, 20 Aug 2013 04:35:31 +0000 (21:35 -0700)]
This reverts commit da4a686a2cfb077a8bfc1697f597e7f86235b822.

Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>

arch/arm/Kconfig
arch/arm/include/asm/smp_twd.h
arch/arm/kernel/smp_twd.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-ux500/timer.c
drivers/clocksource/tegra20_timer.c

index 18a9f5e..ebfd115 100644 (file)
@@ -1509,7 +1509,6 @@ config HAVE_ARM_ARCH_TIMER
 config HAVE_ARM_TWD
        bool
        depends on SMP
-       select CLKSRC_OF if OF
        help
          This options enables support for the ARM timer and watchdog unit
 
index 7b2899c..0f01f46 100644 (file)
@@ -34,4 +34,12 @@ struct twd_local_timer name __initdata = {   \
 
 int twd_local_timer_register(struct twd_local_timer *);
 
+#ifdef CONFIG_HAVE_ARM_TWD
+void twd_local_timer_of_register(void);
+#else
+static inline void twd_local_timer_of_register(void)
+{
+}
+#endif
+
 #endif
index f6fd1d4..325d4b1 100644 (file)
@@ -362,13 +362,25 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
 }
 
 #ifdef CONFIG_OF
-static void __init twd_local_timer_of_register(struct device_node *np)
+const static struct of_device_id twd_of_match[] __initconst = {
+       { .compatible = "arm,cortex-a9-twd-timer",      },
+       { .compatible = "arm,cortex-a5-twd-timer",      },
+       { .compatible = "arm,arm11mp-twd-timer",        },
+       { },
+};
+
+void __init twd_local_timer_of_register(void)
 {
+       struct device_node *np;
        int err;
 
        if (!is_smp() || !setup_max_cpus)
                return;
 
+       np = of_find_matching_node(NULL, twd_of_match);
+       if (!np)
+               return;
+
        twd_ppi = irq_of_parse_and_map(np, 0);
        if (!twd_ppi) {
                err = -EINVAL;
@@ -386,7 +398,4 @@ static void __init twd_local_timer_of_register(struct device_node *np)
 out:
        WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
 }
-CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
-CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
-CLOCKSOURCE_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);
 #endif
index f8b23b8..427980e 100644 (file)
@@ -610,7 +610,7 @@ void __init omap4_local_timer_init(void)
                int err;
 
                if (of_have_populated_dt()) {
-                       clocksource_of_init();
+                       twd_local_timer_of_register();
                        return;
                }
 
index b6bd0ef..290b9c5 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/io.h>
 #include <linux/errno.h>
 #include <linux/clksrc-dbx500-prcmu.h>
-#include <linux/clocksource.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_data/clocksource-nomadik-mtu.h>
@@ -33,7 +32,7 @@ static void __init ux500_twd_init(void)
        twd_local_timer = &u8500_twd_local_timer;
 
        if (of_have_populated_dt())
-               clocksource_of_init();
+               twd_local_timer_of_register();
        else {
                err = twd_local_timer_register(twd_local_timer);
                if (err)
index 2e4d8a6..15cc723 100644 (file)
@@ -218,6 +218,9 @@ static void __init tegra20_init_timer(struct device_node *np)
        tegra_clockevent.irq = tegra_timer_irq.irq;
        clockevents_config_and_register(&tegra_clockevent, 1000000,
                                        0x1, 0x1fffffff);
+#ifdef CONFIG_HAVE_ARM_TWD
+       twd_local_timer_of_register();
+#endif
 }
 CLOCKSOURCE_OF_DECLARE(tegra20_timer, "nvidia,tegra20-timer", tegra20_init_timer);