pci-acpi.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. void acpi_pci_add_bus(struct pci_bus *bus);
  36. void acpi_pci_remove_bus(struct pci_bus *bus);
  37. #ifdef CONFIG_ACPI_PCI_SLOT
  38. void acpi_pci_slot_init(void);
  39. void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle);
  40. void acpi_pci_slot_remove(struct pci_bus *bus);
  41. #else
  42. static inline void acpi_pci_slot_init(void) { }
  43. static inline void acpi_pci_slot_enumerate(struct pci_bus *bus,
  44. acpi_handle handle) { }
  45. static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }
  46. #endif
  47. #else /* CONFIG_ACPI */
  48. static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
  49. static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }
  50. #endif /* CONFIG_ACPI */
  51. #ifdef CONFIG_ACPI_APEI
  52. extern bool aer_acpi_firmware_first(void);
  53. #else
  54. static inline bool aer_acpi_firmware_first(void) { return false; }
  55. #endif
  56. #endif /* _PCI_ACPI_H_ */