Skip to content

Commit

Permalink
MIPS: IP27: Convert to new irq_chip functions
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gleixner <[email protected]>
To: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/2203/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
KAGA-KOKO authored and ralfbaechle committed Mar 25, 2011
1 parent 9458ea5 commit 301218d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
38 changes: 18 additions & 20 deletions arch/mips/sgi-ip27/ip27-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,24 +240,24 @@ static int intr_disconnect_level(int cpu, int bit)
}

/* 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;
bridgereg_t device;
bridge_t *bridge;
int pin, swlevel;
cpuid_t cpu;

pin = SLOT_FROM_PCI_IRQ(irq);
bc = IRQ_TO_BRIDGE(irq);
pin = SLOT_FROM_PCI_IRQ(d->irq);
bc = IRQ_TO_BRIDGE(d->irq);
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
* 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_enable |= (1 << pin);
bridge->b_int_enable |= 0x7ffffe00; /* more stuff in int_enable */
Expand Down Expand Up @@ -288,53 +288,51 @@ static unsigned int startup_bridge_irq(unsigned int irq)
}

/* 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;
int pin, swlevel;
cpuid_t cpu;

pr_debug("bridge_shutdown: irq 0x%x\n", irq);
pin = SLOT_FROM_PCI_IRQ(irq);
pr_debug("bridge_shutdown: irq 0x%x\n", d->irq);
pin = SLOT_FROM_PCI_IRQ(d->irq);

/*
* map irq to a swlevel greater than 6 since the first 6 bits
* of INT_PEND0 are taken
*/
swlevel = find_level(&cpu, irq);
swlevel = find_level(&cpu, d->irq);
intr_disconnect_level(cpu, swlevel);

bridge->b_int_enable &= ~(1 << pin);
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;
int swlevel;

swlevel = find_level(&cpu, irq); /* Criminal offence */
swlevel = find_level(&cpu, d->irq); /* Criminal offence */
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;
int swlevel;

swlevel = find_level(&cpu, irq); /* Criminal offence */
swlevel = find_level(&cpu, d->irq); /* Criminal offence */
intr_disconnect_level(cpu, swlevel);
}

static struct irq_chip bridge_irq_type = {
.name = "bridge",
.startup = startup_bridge_irq,
.shutdown = shutdown_bridge_irq,
.ack = disable_bridge_irq,
.mask = disable_bridge_irq,
.mask_ack = disable_bridge_irq,
.unmask = enable_bridge_irq,
.irq_startup = startup_bridge_irq,
.irq_shutdown = shutdown_bridge_irq,
.irq_mask = disable_bridge_irq,
.irq_unmask = enable_bridge_irq,
};

void __devinit register_bridge_irq(unsigned int irq)
Expand Down
11 changes: 4 additions & 7 deletions arch/mips/sgi-ip27/ip27-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,18 @@
#include <asm/sn/sn0/hubio.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 = {
.name = "SN HUB RT timer",
.ack = disable_rt_irq,
.mask = disable_rt_irq,
.mask_ack = disable_rt_irq,
.unmask = enable_rt_irq,
.eoi = enable_rt_irq,
.irq_mask = disable_rt_irq,
.irq_unmask = enable_rt_irq,
};

static int rt_next_event(unsigned long delta, struct clock_event_device *evt)
Expand Down

0 comments on commit 301218d

Please sign in to comment.