summaryrefslogtreecommitdiffstats
path: root/drivers/of/irq.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-09-19 23:47:37 +0200
committerGrant Likely <grant.likely@linaro.org>2013-10-29 00:48:14 +0100
commit79d9701559a9f3e9b2021fbd292f5e70ad75f686 (patch)
treebbbcc05e19c73ffe9f6a5b71c8c45c5e051c2747 /drivers/of/irq.c
parentmicroblaze/pci: Drop PowerPC-ism from irq parsing (diff)
downloadlinux-79d9701559a9f3e9b2021fbd292f5e70ad75f686.tar.xz
linux-79d9701559a9f3e9b2021fbd292f5e70ad75f686.zip
of/irq: create interrupts-extended property
The standard interrupts property in device tree can only handle interrupts coming from a single interrupt parent. If a device is wired to multiple interrupt controllers, then it needs to be attached to a node with an interrupt-map property to demux the interrupt specifiers which is confusing. It would be a lot easier if there was a form of the interrupts property that allows for a separate interrupt phandle for each interrupt specifier. This patch does exactly that by creating a new interrupts-extended property which reuses the phandle+arguments pattern used by GPIOs and other core bindings. Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Kumar Gala <galak@codeaurora.org> [grant.likely: removed versatile platform hunks into separate patch] Cc: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'drivers/of/irq.c')
-rw-r--r--drivers/of/irq.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 7c4ff122785f..8cc62b4a7988 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -292,17 +292,23 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
return of_irq_parse_oldworld(device, index, out_irq);
+ /* Get the reg property (if any) */
+ addr = of_get_property(device, "reg", NULL);
+
/* Get the interrupts property */
intspec = of_get_property(device, "interrupts", &intlen);
- if (intspec == NULL)
- return -EINVAL;
+ if (intspec == NULL) {
+ /* Try the new-style interrupts-extended */
+ res = of_parse_phandle_with_args(device, "interrupts-extended",
+ "#interrupt-cells", index, out_irq);
+ if (res)
+ return -EINVAL;
+ return of_irq_parse_raw(addr, out_irq);
+ }
intlen /= sizeof(*intspec);
pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
- /* Get the reg property (if any) */
- addr = of_get_property(device, "reg", NULL);
-
/* Look for the interrupt parent. */
p = of_irq_find_parent(device);
if (p == NULL)