aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv/kernel/irq-mb93093.c
diff options
context:
space:
mode:
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/*