aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-se/7724/irq.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 19:05:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 19:05:53 -0700
commit47b170af84d18b736bb35932823ec01cfcfe1967 (patch)
treed52acd411c4c2e05b9db553e9b6f4a6bf59f5ca4 /arch/sh/boards/mach-se/7724/irq.c
parentMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc (diff)
parentMerge branch 'common/pinctrl' into sh-latest (diff)
downloadlinux-dev-47b170af84d18b736bb35932823ec01cfcfe1967.tar.xz
linux-dev-47b170af84d18b736bb35932823ec01cfcfe1967.zip
Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh
Pull SuperH updates from Paul Mundt: - Migration off of old-style dynamic IRQ API. - irqdomain and generic irq chip propagation. - div4/6 clock consolidation, another step towards co-existing with the common struct clk infrastructure. - Extensive PFC rework - Decoupling GPIO from pin state. - Initial pinctrl support to facilitate incremental migration off of legacy pinmux. - gpiolib support made optional, and made pinctrl-backed. * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: (38 commits) sh: pfc: pin config get/set support. sh: pfc: Prefer DRV_NAME over KBUILD_MODNAME. sh: pfc: pinctrl legacy group support. sh: pfc: Ignore pinmux GPIOs with invalid enum IDs. sh: pfc: Export pinctrl binding init symbol. sh: pfc: Error out on pinctrl init resolution failure. sh: pfc: Make pr_fmt consistent across pfc drivers. sh: pfc: pinctrl legacy function support. sh: pfc: Rudimentary pinctrl-backed GPIO support. sh: pfc: Dumb GPIO stringification. sh: pfc: Shuffle PFC support core. sh: pfc: Verify pin type encoding size at build time. sh: pfc: Kill off unused pinmux bias flags. sh: pfc: Make gpio chip support optional where possible. sh: pfc: Split out gpio chip support. sh64: Fix up section mismatch warnings. sh64: Attempt to make reserved insn trap handler resemble C. sh: Consolidate die definitions for trap handlers. sh64: Kill off old exception debugging helpers. sh64: Use generic unaligned access control/counters. ...
Diffstat (limited to 'arch/sh/boards/mach-se/7724/irq.c')
-rw-r--r--arch/sh/boards/mach-se/7724/irq.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c
index c6342ce7768d..5d1d3ec9a6cd 100644
--- a/arch/sh/boards/mach-se/7724/irq.c
+++ b/arch/sh/boards/mach-se/7724/irq.c
@@ -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 {
@@ -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 */
@@ -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);