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
15 # SPDX-License-Identifier: GPL-2.0
18 +config CEVT_SYSTICK_QUIRK
24 depends on SOC_RT305X || SOC_MT7620
28 + select CEVT_SYSTICK_QUIRK
32 --- a/arch/mips/kernel/cevt-r4k.c
33 +++ b/arch/mips/kernel/cevt-r4k.c
36 #include <asm/cevt-r4k.h>
38 +static int mips_state_oneshot(struct clock_event_device *evt)
40 + if (!cp0_timer_irq_installed) {
41 + cp0_timer_irq_installed = 1;
42 + setup_irq(evt->irq, &c0_compare_irqaction);
48 +static int mips_state_shutdown(struct clock_event_device *evt)
50 + if (cp0_timer_irq_installed) {
51 + cp0_timer_irq_installed = 0;
52 + remove_irq(evt->irq, &c0_compare_irqaction);
58 static int mips_next_event(unsigned long delta,
59 struct clock_event_device *evt)
61 @@ -281,17 +301,21 @@ int r4k_clockevent_init(void)
64 cd->cpumask = cpumask_of(cpu);
65 + cd->set_state_shutdown = mips_state_shutdown;
66 + cd->set_state_oneshot = mips_state_oneshot;
67 cd->set_next_event = mips_next_event;
68 cd->event_handler = mips_event_handler;
70 clockevents_config_and_register(cd, mips_hpt_frequency, min_delta, 0x7fffffff);
72 +#ifndef CONFIG_CEVT_SYSTICK_QUIRK
73 if (cp0_timer_irq_installed)
76 cp0_timer_irq_installed = 1;
78 setup_irq(irq, &c0_compare_irqaction);