aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/smp_twd.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/smp_twd.c')
-rw-r--r--arch/arm/kernel/smp_twd.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 761826c628b..a622e7a8b12 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -18,7 +18,7 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/jiffies.h> 19#include <linux/jiffies.h>
20#include <linux/clockchips.h> 20#include <linux/clockchips.h>
21#include <linux/irq.h> 21#include <linux/interrupt.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/of_irq.h> 23#include <linux/of_irq.h>
24#include <linux/of_address.h> 24#include <linux/of_address.h>
@@ -28,7 +28,7 @@
28#include <asm/hardware/gic.h> 28#include <asm/hardware/gic.h>
29 29
30/* set up by the platform code */ 30/* set up by the platform code */
31void __iomem *twd_base; 31static void __iomem *twd_base;
32 32
33static struct clk *twd_clk; 33static struct clk *twd_clk;
34static unsigned long twd_timer_rate; 34static unsigned long twd_timer_rate;
@@ -80,7 +80,7 @@ static int twd_set_next_event(unsigned long evt,
80 * If a local timer interrupt has occurred, acknowledge and return 1. 80 * If a local timer interrupt has occurred, acknowledge and return 1.
81 * Otherwise, return 0. 81 * Otherwise, return 0.
82 */ 82 */
83int twd_timer_ack(void) 83static int twd_timer_ack(void)
84{ 84{
85 if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) { 85 if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) {
86 __raw_writel(1, twd_base + TWD_TIMER_INTSTAT); 86 __raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
@@ -96,11 +96,6 @@ static void twd_timer_stop(struct clock_event_device *clk)
96 disable_percpu_irq(clk->irq); 96 disable_percpu_irq(clk->irq);
97} 97}
98 98
99/* Temporary hack to be removed when all TWD users are converted to
100 the new registration interface */
101void local_timer_stop(struct clock_event_device *clk)
102 __attribute__ ((alias ("twd_timer_stop")));
103
104#ifdef CONFIG_CPU_FREQ 99#ifdef CONFIG_CPU_FREQ
105 100
106/* 101/*
@@ -230,28 +225,10 @@ static struct clk *twd_get_clock(void)
230/* 225/*
231 * Setup the local clock events for a CPU. 226 * Setup the local clock events for a CPU.
232 */ 227 */
233int __cpuinit twd_timer_setup(struct clock_event_device *clk) 228static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
234{ 229{
235 struct clock_event_device **this_cpu_clk; 230 struct clock_event_device **this_cpu_clk;
236 231
237 if (!twd_evt) {
238 int err;
239
240 twd_evt = alloc_percpu(struct clock_event_device *);
241 if (!twd_evt) {
242 pr_err("twd: can't allocate memory\n");
243 return -ENOMEM;
244 }
245
246 err = request_percpu_irq(clk->irq, twd_handler,
247 "twd", twd_evt);
248 if (err) {
249 pr_err("twd: can't register interrupt %d (%d)\n",
250 clk->irq, err);
251 return err;
252 }
253 }
254
255 if (!twd_clk) 232 if (!twd_clk)
256 twd_clk = twd_get_clock(); 233 twd_clk = twd_get_clock();
257 234
@@ -268,8 +245,7 @@ int __cpuinit twd_timer_setup(struct clock_event_device *clk)
268 clk->rating = 350; 245 clk->rating = 350;
269 clk->set_mode = twd_set_mode; 246 clk->set_mode = twd_set_mode;
270 clk->set_next_event = twd_set_next_event; 247 clk->set_next_event = twd_set_next_event;
271 if (!clk->irq) 248 clk->irq = twd_ppi;
272 clk->irq = twd_ppi;
273 249
274 this_cpu_clk = __this_cpu_ptr(twd_evt); 250 this_cpu_clk = __this_cpu_ptr(twd_evt);
275 *this_cpu_clk = clk; 251 *this_cpu_clk = clk;