[MIPS] Make I8259A_IRQ_BASE customizable
Move I8259A_IRQ_BASE from asm/i8259.h to asm/mach-generic/irq.h and make it really customizable. And remove I8259_IRQ_BASE declared on some platforms. Currently only NEC_CMBVR4133 is using custom I8259A_IRQ_BASE value. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
committed by
Ralf Baechle
parent
97dcb82de6
commit
2fa7937bd8
@@ -54,9 +54,11 @@ static unsigned int cached_irq_mask = 0xffff;
|
||||
|
||||
void disable_8259A_irq(unsigned int irq)
|
||||
{
|
||||
unsigned int mask = 1 << irq;
|
||||
unsigned int mask;
|
||||
unsigned long flags;
|
||||
|
||||
irq -= I8259A_IRQ_BASE;
|
||||
mask = 1 << irq;
|
||||
spin_lock_irqsave(&i8259A_lock, flags);
|
||||
cached_irq_mask |= mask;
|
||||
if (irq & 8)
|
||||
@@ -68,9 +70,11 @@ void disable_8259A_irq(unsigned int irq)
|
||||
|
||||
void enable_8259A_irq(unsigned int irq)
|
||||
{
|
||||
unsigned int mask = ~(1 << irq);
|
||||
unsigned int mask;
|
||||
unsigned long flags;
|
||||
|
||||
irq -= I8259A_IRQ_BASE;
|
||||
mask = ~(1 << irq);
|
||||
spin_lock_irqsave(&i8259A_lock, flags);
|
||||
cached_irq_mask &= mask;
|
||||
if (irq & 8)
|
||||
@@ -82,10 +86,12 @@ void enable_8259A_irq(unsigned int irq)
|
||||
|
||||
int i8259A_irq_pending(unsigned int irq)
|
||||
{
|
||||
unsigned int mask = 1 << irq;
|
||||
unsigned int mask;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
irq -= I8259A_IRQ_BASE;
|
||||
mask = 1 << irq;
|
||||
spin_lock_irqsave(&i8259A_lock, flags);
|
||||
if (irq < 8)
|
||||
ret = inb(PIC_MASTER_CMD) & mask;
|
||||
@@ -134,9 +140,11 @@ static inline int i8259A_irq_real(unsigned int irq)
|
||||
*/
|
||||
void mask_and_ack_8259A(unsigned int irq)
|
||||
{
|
||||
unsigned int irqmask = 1 << irq;
|
||||
unsigned int irqmask;
|
||||
unsigned long flags;
|
||||
|
||||
irq -= I8259A_IRQ_BASE;
|
||||
irqmask = 1 << irq;
|
||||
spin_lock_irqsave(&i8259A_lock, flags);
|
||||
/*
|
||||
* Lightweight spurious IRQ detection. We do not want
|
||||
@@ -322,8 +330,8 @@ void __init init_i8259_irqs (void)
|
||||
|
||||
init_8259A(0);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
|
||||
set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
|
||||
|
||||
setup_irq(PIC_CASCADE_IR, &irq2);
|
||||
setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user