of_pci.h 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #ifndef __OF_PCI_H
  2. #define __OF_PCI_H
  3. #include <linux/pci.h>
  4. #include <linux/msi.h>
  5. struct pci_dev;
  6. struct of_phandle_args;
  7. int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq);
  8. int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin);
  9. struct device_node;
  10. struct device_node *of_pci_find_child_device(struct device_node *parent,
  11. unsigned int devfn);
  12. int of_pci_get_devfn(struct device_node *np);
  13. int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
  14. #if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI)
  15. int of_pci_msi_chip_add(struct msi_chip *chip);
  16. void of_pci_msi_chip_remove(struct msi_chip *chip);
  17. struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node);
  18. #else
  19. static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; }
  20. static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { }
  21. static inline struct msi_chip *
  22. of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
  23. #endif
  24. #endif