aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h47
1 files changed, 43 insertions, 4 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c446b5ca2d38..f27893b3b724 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -49,7 +49,7 @@
49#include <linux/compiler.h> 49#include <linux/compiler.h>
50#include <linux/errno.h> 50#include <linux/errno.h>
51#include <linux/kobject.h> 51#include <linux/kobject.h>
52#include <asm/atomic.h> 52#include <linux/atomic.h>
53#include <linux/device.h> 53#include <linux/device.h>
54#include <linux/io.h> 54#include <linux/io.h>
55#include <linux/irqreturn.h> 55#include <linux/irqreturn.h>
@@ -843,8 +843,8 @@ void pci_enable_ido(struct pci_dev *dev, unsigned long type);
843void pci_disable_ido(struct pci_dev *dev, unsigned long type); 843void pci_disable_ido(struct pci_dev *dev, unsigned long type);
844 844
845enum pci_obff_signal_type { 845enum pci_obff_signal_type {
846 PCI_EXP_OBFF_SIGNAL_L0, 846 PCI_EXP_OBFF_SIGNAL_L0 = 0,
847 PCI_EXP_OBFF_SIGNAL_ALWAYS, 847 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
848}; 848};
849int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 849int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
850void pci_disable_obff(struct pci_dev *dev); 850void pci_disable_obff(struct pci_dev *dev);
@@ -879,7 +879,7 @@ void pdev_enable_device(struct pci_dev *);
879void pdev_sort_resources(struct pci_dev *, struct resource_list *); 879void pdev_sort_resources(struct pci_dev *, struct resource_list *);
880int pci_enable_resources(struct pci_dev *, int mask); 880int pci_enable_resources(struct pci_dev *, int mask);
881void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 881void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
882 int (*)(struct pci_dev *, u8, u8)); 882 int (*)(const struct pci_dev *, u8, u8));
883#define HAVE_PCI_REQ_REGIONS 2 883#define HAVE_PCI_REQ_REGIONS 2
884int __must_check pci_request_regions(struct pci_dev *, const char *); 884int __must_check pci_request_regions(struct pci_dev *, const char *);
885int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); 885int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
@@ -1589,5 +1589,44 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1590 unsigned int len, const char *kw); 1590 unsigned int len, const char *kw);
1591 1591
1592/* PCI <-> OF binding helpers */
1593#ifdef CONFIG_OF
1594struct device_node;
1595extern void pci_set_of_node(struct pci_dev *dev);
1596extern void pci_release_of_node(struct pci_dev *dev);
1597extern void pci_set_bus_of_node(struct pci_bus *bus);
1598extern void pci_release_bus_of_node(struct pci_bus *bus);
1599
1600/* Arch may override this (weak) */
1601extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1602
1603static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
1604{
1605 return pdev ? pdev->dev.of_node : NULL;
1606}
1607
1608static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
1609{
1610 return bus ? bus->dev.of_node : NULL;
1611}
1612
1613#else /* CONFIG_OF */
1614static inline void pci_set_of_node(struct pci_dev *dev) { }
1615static inline void pci_release_of_node(struct pci_dev *dev) { }
1616static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
1617static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
1618#endif /* CONFIG_OF */
1619
1620/**
1621 * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device
1622 * @pdev: the PCI device
1623 *
1624 * if the device is PCIE, return NULL
1625 * if the device isn't connected to a PCIe bridge (that is its parent is a
1626 * legacy PCI bridge and the bridge is directly connected to bus 0), return its
1627 * parent
1628 */
1629struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
1630
1592#endif /* __KERNEL__ */ 1631#endif /* __KERNEL__ */
1593#endif /* LINUX_PCI_H */ 1632#endif /* LINUX_PCI_H */