summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-02 14:38:55 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2015-10-16 13:07:15 +0100
commit82b9b4243c6d99d9e38087fa89183aa7479185e9 (patch)
treeabf24aebdcc73c8ef001e27aed472027ea7d4e9c /drivers/of
parenta251b263346e38b9fafebeb49ada9ce894882616 (diff)
downloadop-kernel-dev-82b9b4243c6d99d9e38087fa89183aa7479185e9.zip
op-kernel-dev-82b9b4243c6d99d9e38087fa89183aa7479185e9.tar.gz
of/irq: Use the msi-map property to provide device-specific MSI domain
While msi-parent is used to point to the MSI controller that works for all the devices behind a root complex, it doesn't allow configurations where each individual device can be routed to a separate MSI controller. The msi-map property provides this flexibility (and much more), so let's add a utility function that parses it, and return the corresponding MSI domain. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/irq.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index ed64d98..0baf626 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -689,6 +689,24 @@ static struct irq_domain *__of_get_msi_domain(struct device_node *np,
}
/**
+ * of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain
+ * @dev: device for which the mapping is to be done.
+ * @rid: Requester ID for the device.
+ *
+ * Walk up the device hierarchy looking for devices with a "msi-map"
+ * property.
+ *
+ * Returns: the MSI domain for this device (or NULL on failure)
+ */
+struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 rid)
+{
+ struct device_node *np = NULL;
+
+ __of_msi_map_rid(dev, &np, rid);
+ return __of_get_msi_domain(np, DOMAIN_BUS_PCI_MSI);
+}
+
+/**
* of_msi_get_domain - Use msi-parent to find the relevant MSI domain
* @dev: device for which the domain is requested
* @np: device node for @dev
OpenPOWER on IntegriCloud