diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-01-27 16:05:53 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-04-23 17:02:14 +0300 |
commit | f1497f3d06ad305aa3a8b3ff6b161b5eace89d0e (patch) | |
tree | c0d8ce6a40060a07e35aa883295004abef9445e2 /drivers | |
parent | 167c6b5ecee1c91867b4a92fcd472e3ddeaeffdc (diff) | |
download | linux-f1497f3d06ad305aa3a8b3ff6b161b5eace89d0e.tar.xz |
irqchip: ixp4xx: Add OF initialization support
This adds support for probing and settin up the IXP4xx
irqchip from device tree.
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/irqchip/irq-ixp4xx.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-ixp4xx.c b/drivers/irqchip/irq-ixp4xx.c index 89c80ce047a7..d576809429ac 100644 --- a/drivers/irqchip/irq-ixp4xx.c +++ b/drivers/irqchip/irq-ixp4xx.c @@ -15,6 +15,9 @@ #include <linux/irqchip.h> #include <linux/irqchip/irq-ixp4xx.h> #include <linux/irqdomain.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/cpu.h> @@ -360,3 +363,41 @@ void __init ixp4xx_irq_init(resource_size_t irqbase, } } EXPORT_SYMBOL_GPL(ixp4xx_irq_init); + +#ifdef CONFIG_OF +int __init ixp4xx_of_init_irq(struct device_node *np, + struct device_node *parent) +{ + struct ixp4xx_irq *ixi = &ixirq; + void __iomem *base; + struct fwnode_handle *fwnode; + bool is_356; + int ret; + + base = of_iomap(np, 0); + if (!base) { + pr_crit("IXP4XX: could not ioremap interrupt controller\n"); + return -ENODEV; + } + fwnode = of_node_to_fwnode(np); + + /* These chip variants have 64 interrupts */ + is_356 = of_device_is_compatible(np, "intel,ixp43x-interrupt") || + of_device_is_compatible(np, "intel,ixp45x-interrupt") || + of_device_is_compatible(np, "intel,ixp46x-interrupt"); + + ret = ixp4xx_irq_setup(ixi, base, fwnode, is_356); + if (ret) + pr_crit("IXP4XX: failed to set up irqchip\n"); + + return ret; +} +IRQCHIP_DECLARE(ixp42x, "intel,ixp42x-interrupt", + ixp4xx_of_init_irq); +IRQCHIP_DECLARE(ixp43x, "intel,ixp43x-interrupt", + ixp4xx_of_init_irq); +IRQCHIP_DECLARE(ixp45x, "intel,ixp45x-interrupt", + ixp4xx_of_init_irq); +IRQCHIP_DECLARE(ixp46x, "intel,ixp46x-interrupt", + ixp4xx_of_init_irq); +#endif |