aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci-acpi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci-acpi.h')
-rw-r--r--include/linux/pci-acpi.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 8837928fbf33..042c166f65d5 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -8,6 +8,8 @@
8#ifndef _PCI_ACPI_H_ 8#ifndef _PCI_ACPI_H_
9#define _PCI_ACPI_H_ 9#define _PCI_ACPI_H_
10 10
11#include <linux/acpi.h>
12
11#define OSC_QUERY_TYPE 0 13#define OSC_QUERY_TYPE 0
12#define OSC_SUPPORT_TYPE 1 14#define OSC_SUPPORT_TYPE 1
13#define OSC_CONTROL_TYPE 2 15#define OSC_CONTROL_TYPE 2
@@ -48,15 +50,7 @@
48 50
49#ifdef CONFIG_ACPI 51#ifdef CONFIG_ACPI
50extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); 52extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
51extern acpi_status __pci_osc_support_set(u32 flags, const char *hid); 53int pci_acpi_osc_support(acpi_handle handle, u32 flags);
52static inline acpi_status pci_osc_support_set(u32 flags)
53{
54 return __pci_osc_support_set(flags, PCI_ROOT_HID_STRING);
55}
56static inline acpi_status pcie_osc_support_set(u32 flags)
57{
58 return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING);
59}
60static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 54static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
61{ 55{
62 /* Find root host bridge */ 56 /* Find root host bridge */
@@ -66,6 +60,15 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
66 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), 60 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus),
67 pdev->bus->number); 61 pdev->bus->number);
68} 62}
63
64static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
65{
66 int seg = pci_domain_nr(pbus), busnr = pbus->number;
67 struct pci_dev *bridge = pbus->self;
68 if (bridge)
69 return DEVICE_ACPI_HANDLE(&(bridge->dev));
70 return acpi_get_pci_rootbridge_handle(seg, busnr);
71}
69#else 72#else
70#if !defined(AE_ERROR) 73#if !defined(AE_ERROR)
71typedef u32 acpi_status; 74typedef u32 acpi_status;
@@ -73,8 +76,6 @@ typedef u32 acpi_status;
73#endif 76#endif
74static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) 77static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
75{return AE_ERROR;} 78{return AE_ERROR;}
76static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;}
77static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;}
78static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 79static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
79{ return NULL; } 80{ return NULL; }
80#endif 81#endif