1 From f8da5caf65926d44581d4e7914b28ceab3d28a7c Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Sun, 14 Jul 2013 23:08:11 +0200
4 Subject: [PATCH 17/57] 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 | 37 +++++++++++++++++++++++++++++++------
10 1 file changed, 31 insertions(+), 6 deletions(-)
12 --- a/arch/mips/kernel/cevt-r4k.c
13 +++ b/arch/mips/kernel/cevt-r4k.c
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;
31 +void mips_set_clock_mode(enum clock_event_mode mode,
32 + struct clock_event_device *evt)
34 +#ifdef CONFIG_CEVT_SYSTICK_QUIRK
36 + case CLOCK_EVT_MODE_ONESHOT:
37 + if (cp0_timer_irq_installed)
40 + cp0_timer_irq_installed = 1;
42 + setup_irq(evt->irq, &c0_compare_irqaction);
45 + case CLOCK_EVT_MODE_SHUTDOWN:
46 + if (!cp0_timer_irq_installed)
49 + cp0_timer_irq_installed = 0;
50 + free_irq(evt->irq, &c0_compare_irqaction);
54 + pr_err("Unhandeled mips clock_mode\n");
60 void mips_event_handler(struct clock_event_device *dev)
68 clockevents_register_device(cd);
70 +#ifndef CONFIG_CEVT_SYSTICK_QUIRK
71 if (cp0_timer_irq_installed)
74 cp0_timer_irq_installed = 1;
76 setup_irq(irq, &c0_compare_irqaction);
81 --- a/arch/mips/ralink/Kconfig
82 +++ b/arch/mips/ralink/Kconfig
86 +config CEVT_SYSTICK_QUIRK
92 depends on SOC_RT305X || SOC_MT7620
96 + select CEVT_SYSTICK_QUIRK