aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-01-10 18:00:54 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2012-03-13 09:45:54 -0400
commit9248510469b46bc17b90cf62cb8d9e7c9a5f9965 (patch)
tree2ee4164b056c9a0ba74941b46dbf7b228e67a293 /arch/arm
parent58458e0327f7a34ef9c8bc512290bf47e3de811b (diff)
ARM: smp_twd: remove old local timer interface
Now that all users of the previous local timer interface have been converted to the runtime registration API, make this interface the only one supported for this driver. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/localtimer.h8
-rw-r--r--arch/arm/include/asm/smp_twd.h6
-rw-r--r--arch/arm/kernel/smp_twd.c34
3 files changed, 5 insertions, 43 deletions
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index f088d63b92c..955eed10ffb 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -11,7 +11,6 @@
11#define __ASM_ARM_LOCALTIMER_H 11#define __ASM_ARM_LOCALTIMER_H
12 12
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/interrupt.h>
15 14
16struct clock_event_device; 15struct clock_event_device;
17 16
@@ -26,13 +25,6 @@ struct local_timer_ops {
26void percpu_timer_setup(void); 25void percpu_timer_setup(void);
27 26
28#ifdef CONFIG_LOCAL_TIMERS 27#ifdef CONFIG_LOCAL_TIMERS
29
30#ifdef CONFIG_HAVE_ARM_TWD
31
32#include "smp_twd.h"
33
34#endif
35
36/* 28/*
37 * Stop the local timer 29 * Stop the local timer
38 */ 30 */
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index 8047e6e580b..0f01f4677bd 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -20,12 +20,6 @@
20 20
21#include <linux/ioport.h> 21#include <linux/ioport.h>
22 22
23struct clock_event_device;
24
25extern void __iomem *twd_base;
26
27int twd_timer_setup(struct clock_event_device *);
28
29struct twd_local_timer { 23struct twd_local_timer {
30 struct resource res[2]; 24 struct resource res[2];
31}; 25};
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;