diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2013-08-09 16:27:09 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2013-08-12 11:27:01 -0400 |
commit | 0d5a6db3aa46faafd0212650bfd709d51240d9da (patch) | |
tree | dea9d680f4ae8aea5628ec8d69b72802f0a4bf28 /include/linux/of_pci.h | |
parent | 0cbdcfcf427b63b9670e56760ef5e67cd7081b35 (diff) |
of: pci: add registry of MSI chips
This commit adds a very basic registry of msi_chip structures, so that
an IRQ controller driver can register an msi_chip, and a PCIe host
controller can find it, based on a 'struct device_node'.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'include/linux/of_pci.h')
-rw-r--r-- | include/linux/of_pci.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 7a04826018c0..fd9c408631a0 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __OF_PCI_H | 2 | #define __OF_PCI_H |
3 | 3 | ||
4 | #include <linux/pci.h> | 4 | #include <linux/pci.h> |
5 | #include <linux/msi.h> | ||
5 | 6 | ||
6 | struct pci_dev; | 7 | struct pci_dev; |
7 | struct of_irq; | 8 | struct of_irq; |
@@ -13,4 +14,15 @@ struct device_node *of_pci_find_child_device(struct device_node *parent, | |||
13 | int of_pci_get_devfn(struct device_node *np); | 14 | int of_pci_get_devfn(struct device_node *np); |
14 | int of_pci_parse_bus_range(struct device_node *node, struct resource *res); | 15 | int of_pci_parse_bus_range(struct device_node *node, struct resource *res); |
15 | 16 | ||
17 | #if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI) | ||
18 | int of_pci_msi_chip_add(struct msi_chip *chip); | ||
19 | void of_pci_msi_chip_remove(struct msi_chip *chip); | ||
20 | struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node); | ||
21 | #else | ||
22 | static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; } | ||
23 | static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { } | ||
24 | static inline struct msi_chip * | ||
25 | of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; } | ||
26 | #endif | ||
27 | |||
16 | #endif | 28 | #endif |