aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv/kernel/irq-mb93093.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-09-26 02:32:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:53 -0400
commit88d6e19900366781739df033e9c0e2532e715fa5 (patch)
tree97c6d48f0d707002c8239efb6e865a0133d69b68 /arch/frv/kernel/irq-mb93093.c
parent1bcbba306048ed86b935d57a95d887c23d52c94b (diff)
[PATCH] FRV: improve FRV's use of generic IRQ handling
Improve FRV's use of generic IRQ handling: (*) Use generic_handle_irq() rather than __do_IRQ() as the latter is obsolete. (*) Don't implement enable() and disable() ops as these will fall back to using unmask() and mask(). (*) Provide mask_ack() functions to avoid a call each to mask() and ack(). (*) Make the cascade handlers always return IRQ_HANDLED. (*) Implement the mask() and unmask() functions in the same order as they're listed in the ops table. Signed-off-by: David Howells <dhowells@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/frv/kernel/irq-mb93093.c')
-rw-r--r--arch/frv/kernel/irq-mb93093.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c
index f60db7988e78..a43a22158956 100644
--- a/arch/frv/kernel/irq-mb93093.c
+++ b/arch/frv/kernel/irq-mb93093.c
@@ -35,40 +35,44 @@
35/* 35/*
36 * off-CPU FPGA PIC operations 36 * off-CPU FPGA PIC operations
37 */ 37 */
38static void frv_fpga_enable(unsigned int irq) 38static void frv_fpga_mask(unsigned int irq)
39{ 39{
40 uint16_t imr = __get_IMR(); 40 uint16_t imr = __get_IMR();
41 41
42 imr &= ~(1 << (irq - IRQ_BASE_FPGA)); 42 imr |= 1 << (irq - IRQ_BASE_FPGA);
43
44 __set_IMR(imr); 43 __set_IMR(imr);
45} 44}
46 45
47static void frv_fpga_disable(unsigned int irq) 46static void frv_fpga_ack(unsigned int irq)
47{
48 __clr_IFR(1 << (irq - IRQ_BASE_FPGA));
49}
50
51static void frv_fpga_mask_ack(unsigned int irq)
48{ 52{
49 uint16_t imr = __get_IMR(); 53 uint16_t imr = __get_IMR();
50 54
51 imr |= 1 << (irq - IRQ_BASE_FPGA); 55 imr |= 1 << (irq - IRQ_BASE_FPGA);
52
53 __set_IMR(imr); 56 __set_IMR(imr);
54}
55 57
56static void frv_fpga_ack(unsigned int irq)
57{
58 __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); 58 __clr_IFR(1 << (irq - IRQ_BASE_FPGA));
59} 59}
60 60
61static void frv_fpga_end(unsigned int irq) 61static void frv_fpga_unmask(unsigned int irq)
62{ 62{
63 uint16_t imr = __get_IMR();
64
65 imr &= ~(1 << (irq - IRQ_BASE_FPGA));
66
67 __set_IMR(imr);
63} 68}
64 69
65static struct irq_chip frv_fpga_pic = { 70static struct irq_chip frv_fpga_pic = {
66 .name = "mb93093", 71 .name = "mb93093",
67 .enable = frv_fpga_enable,
68 .disable = frv_fpga_disable,
69 .ack = frv_fpga_ack, 72 .ack = frv_fpga_ack,
70 .mask = frv_fpga_disable, 73 .mask = frv_fpga_mask,
71 .unmask = frv_fpga_enable, 74 .mask_ack = frv_fpga_mask_ack,
75 .unmask = frv_fpga_unmask,
72 .end = frv_fpga_end, 76 .end = frv_fpga_end,
73}; 77};
74 78
@@ -78,7 +82,6 @@ static struct irq_chip frv_fpga_pic = {
78static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs) 82static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs)
79{ 83{
80 uint16_t imr, mask = (unsigned long) _mask; 84 uint16_t imr, mask = (unsigned long) _mask;
81 irqreturn_t iret = 0;
82 85
83 imr = __get_IMR(); 86 imr = __get_IMR();
84 mask = mask & ~imr & __get_IFR(); 87 mask = mask & ~imr & __get_IFR();
@@ -91,11 +94,10 @@ static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs)
91 irq = 31 - irq; 94 irq = 31 - irq;
92 mask &= ~(1 << irq); 95 mask &= ~(1 << irq);
93 96
94 if (__do_IRQ(IRQ_BASE_FPGA + irq, regs)) 97 generic_irq_handle(IRQ_BASE_FPGA + irq, regs);
95 iret |= IRQ_HANDLED;
96 } 98 }
97 99
98 return iret; 100 return IRQ_HANDLED;
99} 101}
100 102
101/* 103/*