diff options
Diffstat (limited to 'drivers/of/irq.c')
| -rw-r--r-- | drivers/of/irq.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 1cd93549d093..e3816819dbfe 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -479,6 +479,26 @@ out: } EXPORT_SYMBOL_GPL(of_irq_get); +const struct cpumask *of_irq_get_affinity(struct device_node *dev, int index) +{ + struct of_phandle_args oirq; + struct irq_fwspec_info info; + struct irq_fwspec fwspec; + int rc; + + rc = of_irq_parse_one(dev, index, &oirq); + if (rc) + return NULL; + + of_phandle_args_to_fwspec(oirq.np, oirq.args, oirq.args_count, + &fwspec); + + if (irq_populate_fwspec_info(&fwspec, &info)) + return NULL; + + return info.affinity; +} + /** * of_irq_get_byname - Decode a node's IRQ and return it as a Linux IRQ number * @dev: pointer to device tree node @@ -593,8 +613,10 @@ void __init of_irq_init(const struct of_device_id *matches) * are the same distance away from the root irq controller. */ desc->interrupt_parent = of_parse_phandle(np, "interrupts-extended", 0); - if (!desc->interrupt_parent) + if (!desc->interrupt_parent && of_property_present(np, "interrupts")) desc->interrupt_parent = of_irq_find_parent(np); + else if (!desc->interrupt_parent) + desc->interrupt_parent = of_parse_phandle(np, "interrupt-parent", 0); if (desc->interrupt_parent == np) { of_node_put(desc->interrupt_parent); desc->interrupt_parent = NULL; |
