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 diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
13 index d078e61..c2778f2 100644
14 --- a/arch/mips/ralink/Kconfig
15 +++ b/arch/mips/ralink/Kconfig
19 +config CEVT_SYSTICK_QUIRK
25 depends on SOC_RT305X || SOC_MT7620
29 + select CEVT_SYSTICK_QUIRK
33 --- a/arch/mips/kernel/cevt-r4k.c
34 +++ b/arch/mips/kernel/cevt-r4k.c
37 #include <asm/cevt-r4k.h>
39 +static int mips_state_oneshot(struct clock_event_device *evt)
41 + if (!cp0_timer_irq_installed) {
42 + cp0_timer_irq_installed = 1;
43 + setup_irq(evt->irq, &c0_compare_irqaction);
49 +static int mips_state_shutdown(struct clock_event_device *evt)
51 + if (cp0_timer_irq_installed) {
52 + cp0_timer_irq_installed = 0;
53 + remove_irq(evt->irq, &c0_compare_irqaction);
59 static int mips_next_event(unsigned long delta,
60 struct clock_event_device *evt)
65 cd->cpumask = cpumask_of(cpu);
66 + cd->set_state_shutdown = mips_state_shutdown;
67 + cd->set_state_oneshot = mips_state_oneshot;
68 cd->set_next_event = mips_next_event;
69 cd->event_handler = mips_event_handler;
71 clockevents_register_device(cd);
73 +#ifndef CONFIG_CEVT_SYSTICK_QUIRK
74 if (cp0_timer_irq_installed)
77 cp0_timer_irq_installed = 1;
79 setup_irq(irq, &c0_compare_irqaction);