15 #include <linux/kernel.h>
20 #include <asm/i8259.h>
32 static int i8259A_auto_eoi = -1;
34 static void disable_8259A_irq(
struct irq_data *
d);
35 static void enable_8259A_irq(
struct irq_data *
d);
36 static void mask_and_ack_8259A(
struct irq_data *
d);
37 static void init_8259A(
int auto_eoi);
39 static struct irq_chip i8259A_chip = {
41 .irq_mask = disable_8259A_irq,
42 .irq_disable = disable_8259A_irq,
43 .irq_unmask = enable_8259A_irq,
44 .irq_mask_ack = mask_and_ack_8259A,
45 #ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
46 .irq_set_affinity = plat_set_irq_affinity,
57 static unsigned int cached_irq_mask = 0xffff;
59 #define cached_master_mask (cached_irq_mask)
60 #define cached_slave_mask (cached_irq_mask >> 8)
62 static void disable_8259A_irq(
struct irq_data *
d)
69 cached_irq_mask |=
mask;
77 static void enable_8259A_irq(
struct irq_data *
d)
84 cached_irq_mask &=
mask;
123 static inline int i8259A_irq_real(
unsigned int irq)
126 int irqmask = 1 << irq;
146 static void mask_and_ack_8259A(
struct irq_data *d)
168 if (cached_irq_mask & irqmask)
169 goto spurious_8259A_irq;
170 cached_irq_mask |= irqmask;
183 smtc_im_ack_irq(irq);
191 if (i8259A_irq_real(irq))
196 goto handle_real_irq;
199 static int spurious_irq_mask;
204 if (!(spurious_irq_mask & irqmask)) {
206 spurious_irq_mask |= irqmask;
214 goto handle_real_irq;
218 static void i8259A_resume(
void)
220 if (i8259A_auto_eoi >= 0)
221 init_8259A(i8259A_auto_eoi);
224 static void i8259A_shutdown(
void)
230 if (i8259A_auto_eoi >= 0) {
237 .resume = i8259A_resume,
238 .shutdown = i8259A_shutdown,
241 static int __init i8259A_init_sysfs(
void)
249 static void init_8259A(
int auto_eoi)
253 i8259A_auto_eoi = auto_eoi;
301 static struct resource pic1_io_resource = {
308 static struct resource pic2_io_resource = {