#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/irq.h>
+#include <linux/bitops.h>
#include <asm/io.h>
#include <asm/system.h>
-#include <asm/bitops.h>
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/irc-regs.h>
/*
* off-CPU FPGA PIC operations
*/
-static void frv_fpga_enable(unsigned int irq)
+static void frv_fpga_mask(unsigned int irq)
{
uint16_t imr = __get_IMR();
- imr &= ~(1 << (irq - IRQ_BASE_FPGA));
-
+ imr |= 1 << (irq - IRQ_BASE_FPGA);
__set_IMR(imr);
}
-static void frv_fpga_disable(unsigned int irq)
+static void frv_fpga_ack(unsigned int irq)
+{
+ __clr_IFR(1 << (irq - IRQ_BASE_FPGA));
+}
+
+static void frv_fpga_mask_ack(unsigned int irq)
{
uint16_t imr = __get_IMR();
imr |= 1 << (irq - IRQ_BASE_FPGA);
-
__set_IMR(imr);
-}
-static void frv_fpga_ack(unsigned int irq)
-{
__clr_IFR(1 << (irq - IRQ_BASE_FPGA));
}
-static void frv_fpga_end(unsigned int irq)
+static void frv_fpga_unmask(unsigned int irq)
{
+ uint16_t imr = __get_IMR();
+
+ imr &= ~(1 << (irq - IRQ_BASE_FPGA));
+
+ __set_IMR(imr);
}
static struct irq_chip frv_fpga_pic = {
.name = "mb93093",
- .enable = frv_fpga_enable,
- .disable = frv_fpga_disable,
.ack = frv_fpga_ack,
- .mask = frv_fpga_disable,
- .unmask = frv_fpga_enable,
+ .mask = frv_fpga_mask,
+ .mask_ack = frv_fpga_mask_ack,
+ .unmask = frv_fpga_unmask,
.end = frv_fpga_end,
};
/*
* FPGA PIC interrupt handler
*/
-static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs)
+static irqreturn_t fpga_interrupt(int irq, void *_mask)
{
uint16_t imr, mask = (unsigned long) _mask;
- irqreturn_t iret = 0;
imr = __get_IMR();
mask = mask & ~imr & __get_IFR();
irq = 31 - irq;
mask &= ~(1 << irq);
- if (__do_IRQ(IRQ_BASE_FPGA + irq, regs))
- iret |= IRQ_HANDLED;
+ generic_irq_handle(IRQ_BASE_FPGA + irq);
}
- return iret;
+ return IRQ_HANDLED;
}
/*