27 #include <linux/pci.h>
29 #include <linux/slab.h>
30 #include <linux/module.h>
33 #define PCIEHP_DETECT_PCIE (0)
34 #define PCIEHP_DETECT_ACPI (1)
35 #define PCIEHP_DETECT_AUTO (2)
36 #define PCIEHP_DETECT_DEFAULT PCIEHP_DETECT_AUTO
43 static int slot_detection_mode;
44 static char *pciehp_detect_mode;
47 "Slot detection mode: pcie, acpi, auto\n"
48 " pcie - Use PCIe based slot detection\n"
49 " acpi - Use ACPI for slot detection\n"
50 " auto(default) - Auto select mode. Use acpi option if duplicate\n"
51 " slot ids are found. Otherwise, use pcie option\n");
62 static int __init parse_detect_mode(
void)
64 if (!pciehp_detect_mode)
66 if (!
strcmp(pciehp_detect_mode,
"pcie"))
68 if (!
strcmp(pciehp_detect_mode,
"acpi"))
70 if (!
strcmp(pciehp_detect_mode,
"auto"))
72 warn(
"bad specifier '%s' for pciehp_detect_mode. Use default\n",
93 slot->
number = slot_cap >> 19;
99 handle = DEVICE_ACPI_HANDLE(&pdev->
dev);
101 acpi_slot_detected = 1;
106 .name =
"pciehp_dummy",
109 .probe = dummy_probe,
112 static int __init select_detection_mode(
void)
122 if (acpi_slot_detected && dup_slot_id)
129 slot_detection_mode = parse_detect_mode();
132 slot_detection_mode = select_detection_mode();
135 info(
"Using ACPI for slot detection.\n");