aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of_pci.h
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2016-09-12 17:13:40 +0100
committerWill Deacon <will.deacon@arm.com>2016-09-16 09:34:14 +0100
commit987068fcbdb7a085bb11151b91dc6f4c956c4a1b (patch)
tree158ddef73ee6ccf6787bab15202ce593382341f1 /include/linux/of_pci.h
parentDocs: dt: add PCI IOMMU map bindings (diff)
downloadlinux-dev-987068fcbdb7a085bb11151b91dc6f4c956c4a1b.tar.xz
linux-dev-987068fcbdb7a085bb11151b91dc6f4c956c4a1b.zip
of/irq: Break out msi-map lookup (again)
The PCI msi-map code is already doing double-duty translating IDs and retrieving MSI parents, which unsurprisingly is the same functionality we need for the identically-formatted PCI iommu-map property. Drag the core parsing routine up yet another layer into the general OF-PCI code, and further generalise it for either kind of lookup in either flavour of map property. Acked-by: Rob Herring <robh+dt@kernel.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/of_pci.h')
-rw-r--r--include/linux/of_pci.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index b969e9443962..7fd5cfce9140 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -17,6 +17,9 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin);
int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
int of_get_pci_domain_nr(struct device_node *node);
void of_pci_check_probe_only(void);
+int of_pci_map_rid(struct device_node *np, u32 rid,
+ const char *map_name, const char *map_mask_name,
+ struct device_node **target, u32 *id_out);
#else
static inline int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq)
{
@@ -52,6 +55,13 @@ of_get_pci_domain_nr(struct device_node *node)
return -1;
}
+static inline int of_pci_map_rid(struct device_node *np, u32 rid,
+ const char *map_name, const char *map_mask_name,
+ struct device_node **target, u32 *id_out)
+{
+ return -EINVAL;
+}
+
static inline void of_pci_check_probe_only(void) { }
#endif