Commit ff53afe6 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Matt Turner

alpha: i8259, alcor, jensen wildfire: Convert irq_chip

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
parent 35252254
...@@ -33,10 +33,10 @@ i8259_update_irq_hw(unsigned int irq, unsigned long mask) ...@@ -33,10 +33,10 @@ i8259_update_irq_hw(unsigned int irq, unsigned long mask)
} }
inline void inline void
i8259a_enable_irq(unsigned int irq) i8259a_enable_irq(struct irq_data *d)
{ {
spin_lock(&i8259_irq_lock); spin_lock(&i8259_irq_lock);
i8259_update_irq_hw(irq, cached_irq_mask &= ~(1 << irq)); i8259_update_irq_hw(d->irq, cached_irq_mask &= ~(1 << d->irq));
spin_unlock(&i8259_irq_lock); spin_unlock(&i8259_irq_lock);
} }
...@@ -47,16 +47,18 @@ __i8259a_disable_irq(unsigned int irq) ...@@ -47,16 +47,18 @@ __i8259a_disable_irq(unsigned int irq)
} }
void void
i8259a_disable_irq(unsigned int irq) i8259a_disable_irq(struct irq_data *d)
{ {
spin_lock(&i8259_irq_lock); spin_lock(&i8259_irq_lock);
__i8259a_disable_irq(irq); __i8259a_disable_irq(d->irq);
spin_unlock(&i8259_irq_lock); spin_unlock(&i8259_irq_lock);
} }
void void
i8259a_mask_and_ack_irq(unsigned int irq) i8259a_mask_and_ack_irq(struct irq_data *d)
{ {
unsigned int irq = d->irq;
spin_lock(&i8259_irq_lock); spin_lock(&i8259_irq_lock);
__i8259a_disable_irq(irq); __i8259a_disable_irq(irq);
...@@ -71,9 +73,9 @@ i8259a_mask_and_ack_irq(unsigned int irq) ...@@ -71,9 +73,9 @@ i8259a_mask_and_ack_irq(unsigned int irq)
struct irq_chip i8259a_irq_type = { struct irq_chip i8259a_irq_type = {
.name = "XT-PIC", .name = "XT-PIC",
.unmask = i8259a_enable_irq, .irq_unmask = i8259a_enable_irq,
.mask = i8259a_disable_irq, .irq_mask = i8259a_disable_irq,
.mask_ack = i8259a_mask_and_ack_irq, .irq_mask_ack = i8259a_mask_and_ack_irq,
}; };
void __init void __init
......
...@@ -31,11 +31,9 @@ extern void init_rtc_irq(void); ...@@ -31,11 +31,9 @@ extern void init_rtc_irq(void);
extern void common_init_isa_dma(void); extern void common_init_isa_dma(void);
extern void i8259a_enable_irq(unsigned int); extern void i8259a_enable_irq(struct irq_data *d);
extern void i8259a_disable_irq(unsigned int); extern void i8259a_disable_irq(struct irq_data *d);
extern void i8259a_mask_and_ack_irq(unsigned int); extern void i8259a_mask_and_ack_irq(struct irq_data *d);
extern unsigned int i8259a_startup_irq(unsigned int);
extern void i8259a_end_irq(unsigned int);
extern struct irq_chip i8259a_irq_type; extern struct irq_chip i8259a_irq_type;
extern void init_i8259a_irqs(void); extern void init_i8259a_irqs(void);
......
...@@ -44,31 +44,31 @@ alcor_update_irq_hw(unsigned long mask) ...@@ -44,31 +44,31 @@ alcor_update_irq_hw(unsigned long mask)
} }
static inline void static inline void
alcor_enable_irq(unsigned int irq) alcor_enable_irq(struct irq_data *d)
{ {
alcor_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16)); alcor_update_irq_hw(cached_irq_mask |= 1UL << (d->irq - 16));
} }
static void static void
alcor_disable_irq(unsigned int irq) alcor_disable_irq(struct irq_data *d)
{ {
alcor_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16))); alcor_update_irq_hw(cached_irq_mask &= ~(1UL << (d->irq - 16)));
} }
static void static void
alcor_mask_and_ack_irq(unsigned int irq) alcor_mask_and_ack_irq(struct irq_data *d)
{ {
alcor_disable_irq(irq); alcor_disable_irq(d);
/* On ALCOR/XLT, need to dismiss interrupt via GRU. */ /* On ALCOR/XLT, need to dismiss interrupt via GRU. */
*(vuip)GRU_INT_CLEAR = 1 << (irq - 16); mb(); *(vuip)GRU_INT_CLEAR = 1 << (d->irq - 16); mb();
*(vuip)GRU_INT_CLEAR = 0; mb(); *(vuip)GRU_INT_CLEAR = 0; mb();
} }
static void static void
alcor_isa_mask_and_ack_irq(unsigned int irq) alcor_isa_mask_and_ack_irq(struct irq_data *d)
{ {
i8259a_mask_and_ack_irq(irq); i8259a_mask_and_ack_irq(d);
/* On ALCOR/XLT, need to dismiss interrupt via GRU. */ /* On ALCOR/XLT, need to dismiss interrupt via GRU. */
*(vuip)GRU_INT_CLEAR = 0x80000000; mb(); *(vuip)GRU_INT_CLEAR = 0x80000000; mb();
...@@ -77,9 +77,9 @@ alcor_isa_mask_and_ack_irq(unsigned int irq) ...@@ -77,9 +77,9 @@ alcor_isa_mask_and_ack_irq(unsigned int irq)
static struct irq_chip alcor_irq_type = { static struct irq_chip alcor_irq_type = {
.name = "ALCOR", .name = "ALCOR",
.unmask = alcor_enable_irq, .irq_unmask = alcor_enable_irq,
.mask = alcor_disable_irq, .irq_mask = alcor_disable_irq,
.mask_ack = alcor_mask_and_ack_irq, .irq_mask_ack = alcor_mask_and_ack_irq,
}; };
static void static void
...@@ -126,9 +126,9 @@ alcor_init_irq(void) ...@@ -126,9 +126,9 @@ alcor_init_irq(void)
if (i >= 16+20 && i <= 16+30) if (i >= 16+20 && i <= 16+30)
continue; continue;
set_irq_chip_and_handler(i, &alcor_irq_type, handle_level_irq); set_irq_chip_and_handler(i, &alcor_irq_type, handle_level_irq);
irq_to_desc(i)->status |= IRQ_LEVEL; irq_set_status_flags(i, IRQ_LEVEL);
} }
i8259a_irq_type.ack = alcor_isa_mask_and_ack_irq; i8259a_irq_type.irq_ack = alcor_isa_mask_and_ack_irq;
init_i8259a_irqs(); init_i8259a_irqs();
common_init_isa_dma(); common_init_isa_dma();
......
...@@ -63,34 +63,34 @@ ...@@ -63,34 +63,34 @@
*/ */
static void static void
jensen_local_enable(unsigned int irq) jensen_local_enable(struct irq_data *d)
{ {
/* the parport is really hw IRQ 1, silly Jensen. */ /* the parport is really hw IRQ 1, silly Jensen. */
if (irq == 7) if (d->irq == 7)
i8259a_enable_irq(1); i8259a_enable_irq(d);
} }
static void static void
jensen_local_disable(unsigned int irq) jensen_local_disable(struct irq_data *d)
{ {
/* the parport is really hw IRQ 1, silly Jensen. */ /* the parport is really hw IRQ 1, silly Jensen. */
if (irq == 7) if (d->irq == 7)
i8259a_disable_irq(1); i8259a_disable_irq(d);
} }
static void static void
jensen_local_mask_ack(unsigned int irq) jensen_local_mask_ack(struct irq_data *d)
{ {
/* the parport is really hw IRQ 1, silly Jensen. */ /* the parport is really hw IRQ 1, silly Jensen. */
if (irq == 7) if (d->irq == 7)
i8259a_mask_and_ack_irq(1); i8259a_mask_and_ack_irq(d);
} }
static struct irq_chip jensen_local_irq_type = { static struct irq_chip jensen_local_irq_type = {
.name = "LOCAL", .name = "LOCAL",
.unmask = jensen_local_enable, .irq_unmask = jensen_local_enable,
.mask = jensen_local_disable, .irq_mask = jensen_local_disable,
.mask_ack = jensen_local_mask_ack, .irq_mask_ack = jensen_local_mask_ack,
}; };
static void static void
......
...@@ -104,10 +104,12 @@ wildfire_init_irq_hw(void) ...@@ -104,10 +104,12 @@ wildfire_init_irq_hw(void)
} }
static void static void
wildfire_enable_irq(unsigned int irq) wildfire_enable_irq(struct irq_data *d)
{ {
unsigned int irq = d->irq;
if (irq < 16) if (irq < 16)
i8259a_enable_irq(irq); i8259a_enable_irq(d);
spin_lock(&wildfire_irq_lock); spin_lock(&wildfire_irq_lock);
set_bit(irq, &cached_irq_mask); set_bit(irq, &cached_irq_mask);
...@@ -116,10 +118,12 @@ wildfire_enable_irq(unsigned int irq) ...@@ -116,10 +118,12 @@ wildfire_enable_irq(unsigned int irq)
} }
static void static void
wildfire_disable_irq(unsigned int irq) wildfire_disable_irq(struct irq_data *d)
{ {
unsigned int irq = d->irq;
if (irq < 16) if (irq < 16)
i8259a_disable_irq(irq); i8259a_disable_irq(d);
spin_lock(&wildfire_irq_lock); spin_lock(&wildfire_irq_lock);
clear_bit(irq, &cached_irq_mask); clear_bit(irq, &cached_irq_mask);
...@@ -128,10 +132,12 @@ wildfire_disable_irq(unsigned int irq) ...@@ -128,10 +132,12 @@ wildfire_disable_irq(unsigned int irq)
} }
static void static void
wildfire_mask_and_ack_irq(unsigned int irq) wildfire_mask_and_ack_irq(struct irq_data *d)
{ {
unsigned int irq = d->irq;
if (irq < 16) if (irq < 16)
i8259a_mask_and_ack_irq(irq); i8259a_mask_and_ack_irq(d);
spin_lock(&wildfire_irq_lock); spin_lock(&wildfire_irq_lock);
clear_bit(irq, &cached_irq_mask); clear_bit(irq, &cached_irq_mask);
...@@ -141,9 +147,9 @@ wildfire_mask_and_ack_irq(unsigned int irq) ...@@ -141,9 +147,9 @@ wildfire_mask_and_ack_irq(unsigned int irq)
static struct irq_chip wildfire_irq_type = { static struct irq_chip wildfire_irq_type = {
.name = "WILDFIRE", .name = "WILDFIRE",
.unmask = wildfire_enable_irq, .irq_unmask = wildfire_enable_irq,
.mask = wildfire_disable_irq, .irq_mask = wildfire_disable_irq,
.mask_ack = wildfire_mask_and_ack_irq, .irq_mask_ack = wildfire_mask_and_ack_irq,
}; };
static void __init static void __init
...@@ -177,21 +183,21 @@ wildfire_init_irq_per_pca(int qbbno, int pcano) ...@@ -177,21 +183,21 @@ wildfire_init_irq_per_pca(int qbbno, int pcano)
for (i = 0; i < 16; ++i) { for (i = 0; i < 16; ++i) {
if (i == 2) if (i == 2)
continue; continue;
irq_to_desc(i+irq_bias)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type, set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type,
handle_level_irq); handle_level_irq);
irq_set_status_flags(i + irq_bias, IRQ_LEVEL);
} }
irq_to_desc(36+irq_bias)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(36+irq_bias, &wildfire_irq_type, set_irq_chip_and_handler(36+irq_bias, &wildfire_irq_type,
handle_level_irq); handle_level_irq);
irq_set_status_flags(36 + irq_bias, IRQ_LEVEL);
for (i = 40; i < 64; ++i) { for (i = 40; i < 64; ++i) {
irq_to_desc(i+irq_bias)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type, set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type,
handle_level_irq); handle_level_irq);
irq_set_status_flags(i + irq_bias, IRQ_LEVEL);
} }
setup_irq(32+irq_bias, &isa_enable); setup_irq(32+irq_bias, &isa_enable);
} }
static void __init static void __init
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment