diff options
| author | Marc Zyngier <maz@kernel.org> | 2025-10-20 13:29:20 +0100 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2025-10-27 17:16:32 +0100 |
| commit | 5404f5c06dd41fd4445a01dec77a629e254a62e8 (patch) | |
| tree | 69ec768609d17d957233c3ca350e37036a58f21e /drivers/of | |
| parent | 5324fe21ba9b77b299c02191645a97777cdd73ac (diff) | |
of/irq: Add interrupt affinity reporting interface
Plug the irq_populate_fwspec_info() helper into the OF layer to offer an
interrupt affinity reporting function.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Will Deacon <will@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20251020122944.3074811-4-maz@kernel.org
Diffstat (limited to 'drivers/of')
| -rw-r--r-- | drivers/of/irq.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 65c3c23255b7..168fde921bd2 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 |
