]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
of: pci: add registry of MSI chips
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 9 Aug 2013 20:27:09 +0000 (22:27 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:43 +0000 (10:06 +0200)
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>
include/linux/msi.h
include/linux/of_pci.h

index 0ef1579d692ee7bfb5188cd7598f4fb660264563..b243a258c1d2d84f212fc6018e28dd4e72fb4501 100644 (file)
@@ -83,6 +83,8 @@ struct msi_chip {
 struct msi_chip {
        struct module *owner;
        struct device *dev;
+       struct device_node *of_node;
+       struct list_head list;
 
        int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev,
                         struct msi_desc *desc);
index dde3a4a0fa5d2e29388263a8c0ab8ea87a753c29..d737c53932c05aa0cd2899451b3ffd4b94f719c4 100644 (file)
@@ -56,4 +56,15 @@ static inline struct msi_chip *
 of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
 #endif
 
+#if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI)
+int of_pci_msi_chip_add(struct msi_chip *chip);
+void of_pci_msi_chip_remove(struct msi_chip *chip);
+struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node);
+#else
+static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; }
+static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { }
+static inline struct msi_chip *
+of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
+#endif
+
 #endif