diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2019-09-23 23:10:08 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-09-23 23:10:08 +0200 |
commit | a10a1f60c7a35f59bee803fe2796ec5172e73edb (patch) | |
tree | 6924849cd9fa8e69c08a8f31dfabb025232a229b /drivers/pci/pci.h | |
parent | Merge branch 'pci/encapsulate' (diff) | |
parent | PCI: Get rid of dev->has_secondary_link flag (diff) | |
download | linux-a10a1f60c7a35f59bee803fe2796ec5172e73edb.tar.xz linux-a10a1f60c7a35f59bee803fe2796ec5172e73edb.zip |
Merge branch 'pci/enumeration'
- Consolidate _HPP & _HPX code in pci-acpi.h and remove unnecessary
struct hotplug_program_ops (Krzysztof Wilczynski)
- Fixup PCIe device types to remove the need for dev->has_secondary_link
(Mika Westerberg)
* pci/enumeration:
PCI: Get rid of dev->has_secondary_link flag
PCI: Make pcie_downstream_port() available outside of access.c
PCI/ACPI: Remove unnecessary struct hotplug_program_ops
PCI/ACPI: Move _HPP & _HPX functions to pci-acpi.c
PCI/ACPI: Rename _HPX structs from hpp_* to hpx_*
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 61bbfd611140..9d4edbb57f07 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -125,6 +125,15 @@ static inline bool pci_power_manageable(struct pci_dev *pci_dev) return !pci_has_subordinate(pci_dev) || pci_dev->bridge_d3; } +static inline bool pcie_downstream_port(const struct pci_dev *dev) +{ + int type = pci_pcie_type(dev); + + return type == PCI_EXP_TYPE_ROOT_PORT || + type == PCI_EXP_TYPE_DOWNSTREAM || + type == PCI_EXP_TYPE_PCIE_BRIDGE; +} + int pci_vpd_init(struct pci_dev *dev); void pci_vpd_release(struct pci_dev *dev); void pcie_vpd_create_sysfs_dev_files(struct pci_dev *dev); @@ -650,4 +659,13 @@ static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { } static inline void pci_aer_clear_device_status(struct pci_dev *dev) { } #endif +#ifdef CONFIG_ACPI +int pci_acpi_program_hp_params(struct pci_dev *dev); +#else +static inline int pci_acpi_program_hp_params(struct pci_dev *dev) +{ + return -ENODEV; +} +#endif + #endif /* DRIVERS_PCI_H */ |