of_pci.h 935 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __OF_PCI_H
  3. #define __OF_PCI_H
  4. #include <linux/pci.h>
  5. #include <linux/msi.h>
  6. struct pci_dev;
  7. struct of_phandle_args;
  8. struct device_node;
  9. #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI)
  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. void of_pci_check_probe_only(void);
  14. #else
  15. static inline struct device_node *of_pci_find_child_device(struct device_node *parent,
  16. unsigned int devfn)
  17. {
  18. return NULL;
  19. }
  20. static inline int of_pci_get_devfn(struct device_node *np)
  21. {
  22. return -EINVAL;
  23. }
  24. static inline void of_pci_check_probe_only(void) { }
  25. #endif
  26. #if IS_ENABLED(CONFIG_OF_IRQ)
  27. int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin);
  28. #else
  29. static inline int
  30. of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
  31. {
  32. return 0;
  33. }
  34. #endif
  35. #endif