* 2 of the License, or (at your option) any later version.
*/
+#include <linux/irqdomain.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/of.h>
return of_node_get(bus->bridge->parent->of_node);
return NULL;
}
+
+struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus)
+{
+#ifdef CONFIG_IRQ_DOMAIN
+ struct device_node *np;
+ struct irq_domain *d;
+
+ if (!bus->dev.of_node)
+ return NULL;
+
+ /* Start looking for a phandle to an MSI controller. */
+ np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0);
+ if (!np)
+ return NULL;
+
+ d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
+ if (d)
+ return d;
+
+ return irq_find_host(np);
+#else
+ return NULL;
+#endif
+}
static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
{
+ struct irq_domain *d;
+
/*
* Any firmware interface that can resolve the msi_domain
* should be called from here.
*/
+ d = pci_host_bridge_of_msi_domain(bus);
- return NULL;
+ return d;
}
static void pci_set_bus_msi_domain(struct pci_bus *bus)