summaryrefslogtreecommitdiff
path: root/arch/sh/kernel/localtimer.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-05-03 09:29:27 (GMT)
committerPaul Mundt <lethal@linux-sh.org>2009-05-03 09:29:27 (GMT)
commit25483efeb2e56521e418a59fa93401be156dc3bb (patch)
tree1502eb45f354d8ac5dcec12323518a1f8b0d19eb /arch/sh/kernel/localtimer.c
parentdec56e6312434b2536fedf9d7e9e73d666aaf0a8 (diff)
downloadlinux-25483efeb2e56521e418a59fa93401be156dc3bb.tar.xz
sh: Move dummy clockevents broadcast timer to its new home.
The old arch/sh/kernel/timers/ directly will be going away completely once the rest of the TMU users are migrated, so move the dummy broadcast driver up a level in preparation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/localtimer.c')
-rw-r--r--arch/sh/kernel/localtimer.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/sh/kernel/localtimer.c b/arch/sh/kernel/localtimer.c
new file mode 100644
index 0000000..96e8eae
--- /dev/null
+++ b/arch/sh/kernel/localtimer.c
@@ -0,0 +1,57 @@
+/*
+ * Dummy local timer
+ *
+ * Copyright (C) 2008 Paul Mundt
+ *
+ * cloned from:
+ *
+ * linux/arch/arm/mach-realview/localtimer.c
+ *
+ * Copyright (C) 2002 ARM Ltd.
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/smp.h>
+#include <linux/jiffies.h>
+#include <linux/percpu.h>
+#include <linux/clockchips.h>
+#include <linux/irq.h>
+
+static DEFINE_PER_CPU(struct clock_event_device, local_clockevent);
+
+/*
+ * Used on SMP for either the local timer or SMP_MSG_TIMER
+ */
+void local_timer_interrupt(void)
+{
+ struct clock_event_device *clk = &__get_cpu_var(local_clockevent);
+
+ clk->event_handler(clk);
+}
+
+static void dummy_timer_set_mode(enum clock_event_mode mode,
+ struct clock_event_device *clk)
+{
+}
+
+void __cpuinit local_timer_setup(unsigned int cpu)
+{
+ struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
+
+ clk->name = "dummy_timer";
+ clk->features = CLOCK_EVT_FEAT_DUMMY;
+ clk->rating = 200;
+ clk->mult = 1;
+ clk->set_mode = dummy_timer_set_mode;
+ clk->broadcast = smp_timer_broadcast;
+ clk->cpumask = cpumask_of(cpu);
+
+ clockevents_register_device(clk);
+}