UPSTREAM: irqdomain: Allow domain matching on irq_fwspec
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 11 Apr 2016 08:57:51 +0000 (09:57 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 1 Jul 2016 06:20:47 +0000 (14:20 +0800)
commit16722ef68213dc0af965ea3bac5e8b02fe46444d
treef9058a1f38ac9038d73261c1e8c41452715ecb7e
parentb90092bac21cfb5bea5c0a183818367ee6743b9b
UPSTREAM: irqdomain: Allow domain matching on irq_fwspec

When iterating over the irq domain list, we try to match a domain
either by calling a match() function or by comparing a number
of fields passed as parameters.

Both approaches are a bit restrictive:
- match() is DT specific and only takes a device node
- the fallback case only deals with the fwnode_handle

It would be useful if we had a per-domain function that would
actually perform the matching check on the whole of the
irq_fwspec structure. This would allow for a domain to triage
matching attempts that need to extend beyond the fwnode.

Let's introduce irq_find_matching_fwspec(), which takes a full
blown irq_fwspec structure, and call into a select() function
implemented by the irqdomain. irq_find_matching_fwnode() is
made a wrapper around irq_find_matching_fwspec in order to
preserve compatibility.

Change-Id: I07df9af068d114c80cd97b9cb987a70c0e24afda
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Link: http://lkml.kernel.org/r/1460365075-7316-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from commit 651e8b54abdeeaa36f5f54ffa05c18707a3cc1d0)
include/linux/irqdomain.h
kernel/irq/irqdomain.c