1 From 4977695198a8daf06746cb6c499d754040b6d0ac Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 3 May 2013 00:04:58 +0200
4 Subject: [PATCH 136/164] MIPS: use set_mode() to enable/disable the cevt-r4k
7 Signed-off-by: John Crispin <blogic@openwrt.org>
9 arch/mips/kernel/cevt-r4k.c | 39 ++++++++++++++++++++++++++-------------
10 1 file changed, 26 insertions(+), 13 deletions(-)
12 --- a/arch/mips/kernel/cevt-r4k.c
13 +++ b/arch/mips/kernel/cevt-r4k.c
14 @@ -39,12 +39,6 @@ static int mips_next_event(unsigned long
16 #endif /* CONFIG_MIPS_MT_SMTC */
18 -void mips_set_clock_mode(enum clock_event_mode mode,
19 - struct clock_event_device *evt)
21 - /* Nothing to do ... */
24 DEFINE_PER_CPU(struct clock_event_device, mips_clockevent_device);
25 int cp0_timer_irq_installed;
27 @@ -89,6 +83,32 @@ struct irqaction c0_compare_irqaction =
31 +void mips_set_clock_mode(enum clock_event_mode mode,
32 + struct clock_event_device *evt)
35 + case CLOCK_EVT_MODE_ONESHOT:
36 + if (cp0_timer_irq_installed)
39 + cp0_timer_irq_installed = 1;
41 + setup_irq(evt->irq, &c0_compare_irqaction);
44 + case CLOCK_EVT_MODE_SHUTDOWN:
45 + if (!cp0_timer_irq_installed)
48 + cp0_timer_irq_installed = 0;
49 + free_irq(evt->irq, &c0_compare_irqaction);
53 + pr_err("Unhandeled mips clock_mode\n");
58 void mips_event_handler(struct clock_event_device *dev)
60 @@ -208,13 +228,6 @@ int __cpuinit r4k_clockevent_init(void)
62 clockevents_register_device(cd);
64 - if (cp0_timer_irq_installed)
67 - cp0_timer_irq_installed = 1;
69 - setup_irq(irq, &c0_compare_irqaction);