1 From ce3d4a4111a5f7e6b4e74bceae5faa6ce388e8ec 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 05/53] MIPS: use set_mode() to enable/disable the cevt-r4k
7 Signed-off-by: John Crispin <blogic@openwrt.org>
9 arch/mips/ralink/Kconfig | 5 +++++
10 1 file changed, 5 insertions(+)
12 --- a/arch/mips/ralink/Kconfig
13 +++ b/arch/mips/ralink/Kconfig
17 +config CEVT_SYSTICK_QUIRK
23 depends on SOC_RT305X || SOC_MT7620
27 + select CEVT_SYSTICK_QUIRK
31 --- a/arch/mips/kernel/cevt-r4k.c
32 +++ b/arch/mips/kernel/cevt-r4k.c
35 #include <asm/cevt-r4k.h>
37 +static int mips_state_oneshot(struct clock_event_device *evt)
39 + if (!cp0_timer_irq_installed) {
40 + cp0_timer_irq_installed = 1;
41 + setup_irq(evt->irq, &c0_compare_irqaction);
47 +static int mips_state_shutdown(struct clock_event_device *evt)
49 + if (cp0_timer_irq_installed) {
50 + cp0_timer_irq_installed = 0;
51 + remove_irq(evt->irq, &c0_compare_irqaction);
57 static int mips_next_event(unsigned long delta,
58 struct clock_event_device *evt)
60 @@ -208,18 +228,21 @@ int r4k_clockevent_init(void)
63 cd->cpumask = cpumask_of(cpu);
64 + cd->set_state_shutdown = mips_state_shutdown;
65 + cd->set_state_oneshot = mips_state_oneshot;
66 cd->set_next_event = mips_next_event;
67 cd->event_handler = mips_event_handler;
69 clockevents_register_device(cd);
71 +#ifndef CONFIG_CEVT_SYSTICK_QUIRK
72 if (cp0_timer_irq_installed)
75 cp0_timer_irq_installed = 1;
77 setup_irq(irq, &c0_compare_irqaction);