You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.7 KiB
74 lines
1.7 KiB
11 years ago
|
From cdc1b12b3debaf5b3894fd146e73221a8acd0152 Mon Sep 17 00:00:00 2001
|
||
12 years ago
|
From: John Crispin <blogic@openwrt.org>
|
||
|
Date: Sun, 14 Jul 2013 23:08:11 +0200
|
||
11 years ago
|
Subject: [PATCH 20/25] MIPS: use set_mode() to enable/disable the cevt-r4k
|
||
12 years ago
|
irq
|
||
|
|
||
11 years ago
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||
12 years ago
|
---
|
||
|
arch/mips/kernel/cevt-r4k.c | 39 ++++++++++++++++++++++++++-------------
|
||
|
1 file changed, 26 insertions(+), 13 deletions(-)
|
||
|
|
||
|
--- a/arch/mips/kernel/cevt-r4k.c
|
||
|
+++ b/arch/mips/kernel/cevt-r4k.c
|
||
11 years ago
|
@@ -38,12 +38,6 @@ static int mips_next_event(unsigned long
|
||
12 years ago
|
|
||
|
#endif /* CONFIG_MIPS_MT_SMTC */
|
||
|
|
||
|
-void mips_set_clock_mode(enum clock_event_mode mode,
|
||
|
- struct clock_event_device *evt)
|
||
|
-{
|
||
|
- /* Nothing to do ... */
|
||
|
-}
|
||
|
-
|
||
|
DEFINE_PER_CPU(struct clock_event_device, mips_clockevent_device);
|
||
|
int cp0_timer_irq_installed;
|
||
|
|
||
11 years ago
|
@@ -90,6 +84,32 @@ struct irqaction c0_compare_irqaction =
|
||
12 years ago
|
.name = "timer",
|
||
|
};
|
||
|
|
||
|
+void mips_set_clock_mode(enum clock_event_mode mode,
|
||
|
+ struct clock_event_device *evt)
|
||
|
+{
|
||
|
+ switch (mode) {
|
||
|
+ case CLOCK_EVT_MODE_ONESHOT:
|
||
|
+ if (cp0_timer_irq_installed)
|
||
|
+ break;
|
||
|
+
|
||
|
+ cp0_timer_irq_installed = 1;
|
||
|
+
|
||
|
+ setup_irq(evt->irq, &c0_compare_irqaction);
|
||
|
+ break;
|
||
|
+
|
||
|
+ case CLOCK_EVT_MODE_SHUTDOWN:
|
||
|
+ if (!cp0_timer_irq_installed)
|
||
|
+ break;
|
||
|
+
|
||
|
+ cp0_timer_irq_installed = 0;
|
||
|
+ free_irq(evt->irq, &c0_compare_irqaction);
|
||
|
+ break;
|
||
|
+
|
||
|
+ default:
|
||
|
+ pr_err("Unhandeled mips clock_mode\n");
|
||
|
+ break;
|
||
|
+ }
|
||
|
+}
|
||
|
|
||
|
void mips_event_handler(struct clock_event_device *dev)
|
||
|
{
|
||
|
@@ -215,13 +235,6 @@ int __cpuinit r4k_clockevent_init(void)
|
||
|
#endif
|
||
|
clockevents_register_device(cd);
|
||
|
|
||
|
- if (cp0_timer_irq_installed)
|
||
|
- return 0;
|
||
|
-
|
||
|
- cp0_timer_irq_installed = 1;
|
||
|
-
|
||
|
- setup_irq(irq, &c0_compare_irqaction);
|
||
|
-
|
||
|
return 0;
|
||
|
}
|
||
|
|