aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/au1000/common/irq.c32
-rw-r--r--arch/mips/au1000/common/time.c11
2 files changed, 9 insertions, 34 deletions
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index 59e932a928d2..ddfb7f0a17a6 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -318,38 +318,6 @@ static struct irq_chip level_irq_type = {
318 .end = end_irq, 318 .end = end_irq,
319}; 319};
320 320
321#ifdef CONFIG_PM
322void startup_match20_interrupt(irq_handler_t handler)
323{
324 struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT];
325
326 static struct irqaction action;
327 memset(&action, 0, sizeof(struct irqaction));
328
329 /*
330 * This is a big problem.... since we didn't use request_irq
331 * when kernel/irq.c calls probe_irq_xxx this interrupt will
332 * be probed for usage. This will end up disabling the device :(
333 * Give it a bogus "action" pointer -- this will keep it from
334 * getting auto-probed!
335 *
336 * By setting the status to match that of request_irq() we
337 * can avoid it. --cgray
338 */
339 action.dev_id = handler;
340 action.flags = IRQF_DISABLED;
341 cpus_clear(action.mask);
342 action.name = "Au1xxx TOY";
343 action.handler = handler;
344 action.next = NULL;
345
346 desc->action = &action;
347 desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
348
349 local_enable_irq(AU1000_TOY_MATCH2_INT);
350}
351#endif
352
353static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req) 321static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req)
354{ 322{
355 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 323 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 2556399708ba..c8116bcacf55 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -67,7 +67,7 @@ static DEFINE_SPINLOCK(time_lock);
67unsigned long wtimer; 67unsigned long wtimer;
68 68
69#ifdef CONFIG_PM 69#ifdef CONFIG_PM
70irqreturn_t counter0_irq(int irq, void *dev_id) 70static irqreturn_t counter0_irq(int irq, void *dev_id)
71{ 71{
72 unsigned long pc0; 72 unsigned long pc0;
73 int time_elapsed; 73 int time_elapsed;
@@ -117,6 +117,13 @@ irqreturn_t counter0_irq(int irq, void *dev_id)
117 return IRQ_HANDLED; 117 return IRQ_HANDLED;
118} 118}
119 119
120struct irqaction counter0_action = {
121 .handler = counter0_irq,
122 .flags = IRQF_DISABLED,
123 .name = "alchemy-toy",
124 .dev_id = NULL,
125};
126
120/* When we wakeup from sleep, we have to "catch up" on all of the 127/* When we wakeup from sleep, we have to "catch up" on all of the
121 * timer ticks we have missed. 128 * timer ticks we have missed.
122 */ 129 */
@@ -280,7 +287,7 @@ void __init plat_timer_setup(struct irqaction *irq)
280 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2); 287 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
281 au_sync(); 288 au_sync();
282 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20); 289 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
283 startup_match20_interrupt(counter0_irq); 290 setup_irq(AU1000_TOY_MATCH2_INT, &counter0_action);
284 291
285 /* We can use the real 'wait' instruction. 292 /* We can use the real 'wait' instruction.
286 */ 293 */