nlm: Ensure callback code also checks that the files match
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / pci-acpi.h
CommitLineData
1da177e4
LT
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
8#ifndef _PCI_ACPI_H_
9#define _PCI_ACPI_H_
10
8b62091e
AP
11#include <linux/acpi.h>
12
1da177e4 13#ifdef CONFIG_ACPI
b67ea761
RW
14extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev,
15 struct pci_bus *pci_bus);
16extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
18 struct pci_dev *pci_dev);
19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
f4b57a3b 20extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
b67ea761 21
056c58e8
JS
22static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
23{
d18690af 24 struct pci_bus *pbus = pdev->bus;
059e4ba2 25
d18690af 26 /* Find a PCI root bus */
a222b8f8 27 while (!pci_is_root_bus(pbus))
d18690af 28 pbus = pbus->parent;
059e4ba2
YL
29
30 return DEVICE_ACPI_HANDLE(pbus->bridge);
056c58e8 31}
e8c331e9
KK
32
33static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
34{
059e4ba2
YL
35 struct device *dev;
36
37 if (pci_is_root_bus(pbus))
38 dev = pbus->bridge;
39 else
40 dev = &pbus->self->dev;
41
42 return DEVICE_ACPI_HANDLE(dev);
e8c331e9 43}
5090d4a6
JL
44
45void acpi_pci_add_bus(struct pci_bus *bus);
46void acpi_pci_remove_bus(struct pci_bus *bus);
5c0b04e3
JL
47
48#ifdef CONFIG_ACPI_PCI_SLOT
49void acpi_pci_slot_init(void);
50void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle);
51void acpi_pci_slot_remove(struct pci_bus *bus);
52#else
53static inline void acpi_pci_slot_init(void) { }
54static inline void acpi_pci_slot_enumerate(struct pci_bus *bus,
55 acpi_handle handle) { }
56static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }
57#endif
58
3b63aaa7
JL
59#ifdef CONFIG_HOTPLUG_PCI_ACPI
60void acpiphp_init(void);
61void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle);
62void acpiphp_remove_slots(struct pci_bus *bus);
3f327e39 63void acpiphp_check_host_bridge(acpi_handle handle);
3b63aaa7
JL
64#else
65static inline void acpiphp_init(void) { }
66static inline void acpiphp_enumerate_slots(struct pci_bus *bus,
67 acpi_handle handle) { }
68static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
3f327e39 69static inline void acpiphp_check_host_bridge(acpi_handle handle) { }
3b63aaa7
JL
70#endif
71
5090d4a6
JL
72#else /* CONFIG_ACPI */
73static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
74static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }
75#endif /* CONFIG_ACPI */
1da177e4 76
415e12b2
RW
77#ifdef CONFIG_ACPI_APEI
78extern bool aer_acpi_firmware_first(void);
79#else
80static inline bool aer_acpi_firmware_first(void) { return false; }
81#endif
82
1da177e4 83#endif /* _PCI_ACPI_H_ */