MIPS: IP27: Convert to new irq_chip functions

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2203/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Thomas Gleixner 2011-03-23 21:09:12 +00:00 committed by Ralf Baechle
parent 9458ea567a
commit 301218df9c
2 changed files with 22 additions and 27 deletions

View File

@ -240,7 +240,7 @@ static int intr_disconnect_level(int cpu, int bit)
} }
/* Startup one of the (PCI ...) IRQs routes over a bridge. */ /* Startup one of the (PCI ...) IRQs routes over a bridge. */
static unsigned int startup_bridge_irq(unsigned int irq) static unsigned int startup_bridge_irq(struct irq_data *d)
{ {
struct bridge_controller *bc; struct bridge_controller *bc;
bridgereg_t device; bridgereg_t device;
@ -248,16 +248,16 @@ static unsigned int startup_bridge_irq(unsigned int irq)
int pin, swlevel; int pin, swlevel;
cpuid_t cpu; cpuid_t cpu;
pin = SLOT_FROM_PCI_IRQ(irq); pin = SLOT_FROM_PCI_IRQ(d->irq);
bc = IRQ_TO_BRIDGE(irq); bc = IRQ_TO_BRIDGE(d->irq);
bridge = bc->base; bridge = bc->base;
pr_debug("bridge_startup(): irq= 0x%x pin=%d\n", irq, pin); pr_debug("bridge_startup(): irq= 0x%x pin=%d\n", d->irq, pin);
/* /*
* "map" irq to a swlevel greater than 6 since the first 6 bits * "map" irq to a swlevel greater than 6 since the first 6 bits
* of INT_PEND0 are taken * of INT_PEND0 are taken
*/ */
swlevel = find_level(&cpu, irq); swlevel = find_level(&cpu, d->irq);
bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (bc->nasid << 8)); bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (bc->nasid << 8));
bridge->b_int_enable |= (1 << pin); bridge->b_int_enable |= (1 << pin);
bridge->b_int_enable |= 0x7ffffe00; /* more stuff in int_enable */ bridge->b_int_enable |= 0x7ffffe00; /* more stuff in int_enable */
@ -288,53 +288,51 @@ static unsigned int startup_bridge_irq(unsigned int irq)
} }
/* Shutdown one of the (PCI ...) IRQs routes over a bridge. */ /* Shutdown one of the (PCI ...) IRQs routes over a bridge. */
static void shutdown_bridge_irq(unsigned int irq) static void shutdown_bridge_irq(struct irq_data *d)
{ {
struct bridge_controller *bc = IRQ_TO_BRIDGE(irq); struct bridge_controller *bc = IRQ_TO_BRIDGE(d->irq);
bridge_t *bridge = bc->base; bridge_t *bridge = bc->base;
int pin, swlevel; int pin, swlevel;
cpuid_t cpu; cpuid_t cpu;
pr_debug("bridge_shutdown: irq 0x%x\n", irq); pr_debug("bridge_shutdown: irq 0x%x\n", d->irq);
pin = SLOT_FROM_PCI_IRQ(irq); pin = SLOT_FROM_PCI_IRQ(d->irq);
/* /*
* map irq to a swlevel greater than 6 since the first 6 bits * map irq to a swlevel greater than 6 since the first 6 bits
* of INT_PEND0 are taken * of INT_PEND0 are taken
*/ */
swlevel = find_level(&cpu, irq); swlevel = find_level(&cpu, d->irq);
intr_disconnect_level(cpu, swlevel); intr_disconnect_level(cpu, swlevel);
bridge->b_int_enable &= ~(1 << pin); bridge->b_int_enable &= ~(1 << pin);
bridge->b_wid_tflush; bridge->b_wid_tflush;
} }
static inline void enable_bridge_irq(unsigned int irq) static inline void enable_bridge_irq(struct irq_data *d)
{ {
cpuid_t cpu; cpuid_t cpu;
int swlevel; int swlevel;
swlevel = find_level(&cpu, irq); /* Criminal offence */ swlevel = find_level(&cpu, d->irq); /* Criminal offence */
intr_connect_level(cpu, swlevel); intr_connect_level(cpu, swlevel);
} }
static inline void disable_bridge_irq(unsigned int irq) static inline void disable_bridge_irq(struct irq_data *d)
{ {
cpuid_t cpu; cpuid_t cpu;
int swlevel; int swlevel;
swlevel = find_level(&cpu, irq); /* Criminal offence */ swlevel = find_level(&cpu, d->irq); /* Criminal offence */
intr_disconnect_level(cpu, swlevel); intr_disconnect_level(cpu, swlevel);
} }
static struct irq_chip bridge_irq_type = { static struct irq_chip bridge_irq_type = {
.name = "bridge", .name = "bridge",
.startup = startup_bridge_irq, .irq_startup = startup_bridge_irq,
.shutdown = shutdown_bridge_irq, .irq_shutdown = shutdown_bridge_irq,
.ack = disable_bridge_irq, .irq_mask = disable_bridge_irq,
.mask = disable_bridge_irq, .irq_unmask = enable_bridge_irq,
.mask_ack = disable_bridge_irq,
.unmask = enable_bridge_irq,
}; };
void __devinit register_bridge_irq(unsigned int irq) void __devinit register_bridge_irq(unsigned int irq)

View File

@ -36,21 +36,18 @@
#include <asm/sn/sn0/hubio.h> #include <asm/sn/sn0/hubio.h>
#include <asm/pci/bridge.h> #include <asm/pci/bridge.h>
static void enable_rt_irq(unsigned int irq) static void enable_rt_irq(struct irq_data *d)
{ {
} }
static void disable_rt_irq(unsigned int irq) static void disable_rt_irq(struct irq_data *d)
{ {
} }
static struct irq_chip rt_irq_type = { static struct irq_chip rt_irq_type = {
.name = "SN HUB RT timer", .name = "SN HUB RT timer",
.ack = disable_rt_irq, .irq_mask = disable_rt_irq,
.mask = disable_rt_irq, .irq_unmask = enable_rt_irq,
.mask_ack = disable_rt_irq,
.unmask = enable_rt_irq,
.eoi = enable_rt_irq,
}; };
static int rt_next_event(unsigned long delta, struct clock_event_device *evt) static int rt_next_event(unsigned long delta, struct clock_event_device *evt)