Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __OF_PCI_H
0003 #define __OF_PCI_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/errno.h>
0007 
0008 struct pci_dev;
0009 struct device_node;
0010 
0011 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI)
0012 struct device_node *of_pci_find_child_device(struct device_node *parent,
0013                          unsigned int devfn);
0014 int of_pci_get_devfn(struct device_node *np);
0015 void of_pci_check_probe_only(void);
0016 #else
0017 static inline struct device_node *of_pci_find_child_device(struct device_node *parent,
0018                          unsigned int devfn)
0019 {
0020     return NULL;
0021 }
0022 
0023 static inline int of_pci_get_devfn(struct device_node *np)
0024 {
0025     return -EINVAL;
0026 }
0027 
0028 static inline void of_pci_check_probe_only(void) { }
0029 #endif
0030 
0031 #if IS_ENABLED(CONFIG_OF_IRQ)
0032 int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin);
0033 #else
0034 static inline int
0035 of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
0036 {
0037     return 0;
0038 }
0039 #endif
0040 
0041 #endif