pci-acpi.h 846 B

123456789101112131415161718192021222324252627282930313233343536
  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. static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
  12. {
  13. struct pci_bus *pbus = pdev->bus;
  14. /* Find a PCI root bus */
  15. while (pbus->parent)
  16. pbus = pbus->parent;
  17. return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
  18. pbus->number);
  19. }
  20. static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
  21. {
  22. if (pbus->parent)
  23. return DEVICE_ACPI_HANDLE(&(pbus->self->dev));
  24. return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
  25. pbus->number);
  26. }
  27. #else
  28. static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
  29. { return NULL; }
  30. #endif
  31. #endif /* _PCI_ACPI_H_ */