of_pci.h 915 B

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