Skip to content

Commit

Permalink
sh: mach-se: Migrate 7724SE off of deprecated dynamic IRQ API.
Browse files Browse the repository at this point in the history
The generic hardirq layer provides all of the routines that we need these
days, so we don't require any of the dynamic IRQ API wrapping, and can
call in to irq_alloc_descs() directly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed May 18, 2012
1 parent cf00c55 commit d0e05bb
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions arch/sh/boards/mach-se/7724/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <linux/export.h>
#include <linux/topology.h>
#include <linux/io.h>
#include <linux/err.h>
#include <mach-se/mach/se7724.h>

struct fpga_irq {
Expand Down Expand Up @@ -111,7 +113,7 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
*/
void __init init_se7724_IRQ(void)
{
int i, nid = cpu_to_node(boot_cpu_data);
int irq_base, i;

__raw_writew(0xffff, IRQ0_MR); /* mask all */
__raw_writew(0xffff, IRQ1_MR); /* mask all */
Expand All @@ -121,28 +123,16 @@ void __init init_se7724_IRQ(void)
__raw_writew(0x0000, IRQ2_SR); /* clear irq */
__raw_writew(0x002a, IRQ_MODE); /* set irq type */

for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) {
int irq, wanted;

wanted = SE7724_FPGA_IRQ_BASE + i;

irq = create_irq_nr(wanted, nid);
if (unlikely(irq == 0)) {
pr_err("%s: failed hooking irq %d for FPGA\n",
__func__, wanted);
return;
}

if (unlikely(irq != wanted)) {
pr_err("%s: got irq %d but wanted %d, bailing.\n",
__func__, irq, wanted);
destroy_irq(irq);
return;
}
irq_base = irq_alloc_descs(SE7724_FPGA_IRQ_BASE, SE7724_FPGA_IRQ_BASE,
SE7724_FPGA_IRQ_NR, numa_node_id());
if (IS_ERR_VALUE(irq_base)) {
pr_err("%s: failed hooking irqs for FPGA\n", __func__);
return;
}

irq_set_chip_and_handler_name(irq, &se7724_irq_chip,
for (i = 0; i < SE7724_FPGA_IRQ_NR; i++)
irq_set_chip_and_handler_name(irq_base + i, &se7724_irq_chip,
handle_level_irq, "level");
}

irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux);
irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
Expand Down

0 comments on commit d0e05bb

Please sign in to comment.