pci-acpi.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * File pci-acpi.h
  3. *
  4. * Copyright (C) 2004 Intel
  5. * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
  6. */
  7. #ifndef _PCI_ACPI_H_
  8. #define _PCI_ACPI_H_
  9. #include <linux/acpi.h>
  10. #ifdef CONFIG_ACPI
  11. extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev,
  12. struct pci_bus *pci_bus);
  13. extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
  14. extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
  15. struct pci_dev *pci_dev);
  16. extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
  17. extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
  18. static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
  19. {
  20. struct pci_bus *pbus = pdev->bus;
  21. /* Find a PCI root bus */
  22. while (!pci_is_root_bus(pbus))
  23. pbus = pbus->parent;
  24. return DEVICE_ACPI_HANDLE(pbus->bridge);
  25. }
  26. static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
  27. {
  28. struct device *dev;
  29. if (pci_is_root_bus(pbus))
  30. dev = pbus->bridge;
  31. else
  32. dev = &pbus->self->dev;
  33. return DEVICE_ACPI_HANDLE(dev);
  34. }
  35. #endif
  36. #ifdef CONFIG_ACPI_APEI
  37. extern bool aer_acpi_firmware_first(void);
  38. #else
  39. static inline bool aer_acpi_firmware_first(void) { return false; }
  40. #endif
  41. #endif /* _PCI_ACPI_H_ */