aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2007-07-23 08:44:41 -0400
committerLen Brown <len.brown@intel.com>2007-07-23 13:56:42 -0400
commit1ba90e3a87c46500623afdc3898573e4a5ebb21b (patch)
treeb324171b526be3562c87d9ed99ef51c39d77ed45
parent29b71a1ca74491fab9fed09e9d835d840d042690 (diff)
ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers
modpost is going to use these to create e.g. acpi:ACPI0001 in modules.alias. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/ac.c9
-rw-r--r--drivers/acpi/acpi_memhotplug.c8
-rw-r--r--drivers/acpi/asus_acpi.c11
-rw-r--r--drivers/acpi/battery.c9
-rw-r--r--drivers/acpi/button.c12
-rw-r--r--drivers/acpi/container.c10
-rw-r--r--drivers/acpi/ec.c8
-rw-r--r--drivers/acpi/fan.c8
-rw-r--r--drivers/acpi/pci_link.c9
-rw-r--r--drivers/acpi/pci_root.c9
-rw-r--r--drivers/acpi/power.c8
-rw-r--r--drivers/acpi/processor_core.c8
-rw-r--r--drivers/acpi/sbs.c10
-rw-r--r--drivers/acpi/thermal.c8
-rw-r--r--drivers/acpi/video.c8
-rw-r--r--drivers/char/hpet.c8
-rw-r--r--drivers/input/misc/atlas_btns.c9
-rw-r--r--drivers/misc/asus-laptop.c9
-rw-r--r--drivers/misc/sony-laptop.c21
-rw-r--r--drivers/misc/thinkpad_acpi.c20
-rw-r--r--drivers/misc/thinkpad_acpi.h2
21 files changed, 169 insertions, 35 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 37c7dc4f9fe5..d8b35093527a 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -34,7 +34,6 @@
34 34
35#define ACPI_AC_COMPONENT 0x00020000 35#define ACPI_AC_COMPONENT 0x00020000
36#define ACPI_AC_CLASS "ac_adapter" 36#define ACPI_AC_CLASS "ac_adapter"
37#define ACPI_AC_HID "ACPI0003"
38#define ACPI_AC_DEVICE_NAME "AC Adapter" 37#define ACPI_AC_DEVICE_NAME "AC Adapter"
39#define ACPI_AC_FILE_STATE "state" 38#define ACPI_AC_FILE_STATE "state"
40#define ACPI_AC_NOTIFY_STATUS 0x80 39#define ACPI_AC_NOTIFY_STATUS 0x80
@@ -56,10 +55,16 @@ static int acpi_ac_add(struct acpi_device *device);
56static int acpi_ac_remove(struct acpi_device *device, int type); 55static int acpi_ac_remove(struct acpi_device *device, int type);
57static int acpi_ac_open_fs(struct inode *inode, struct file *file); 56static int acpi_ac_open_fs(struct inode *inode, struct file *file);
58 57
58const static struct acpi_device_id ac_device_ids[] = {
59 {"ACPI0003", 0},
60 {"", 0},
61};
62MODULE_DEVICE_TABLE(acpi, ac_device_ids);
63
59static struct acpi_driver acpi_ac_driver = { 64static struct acpi_driver acpi_ac_driver = {
60 .name = "ac", 65 .name = "ac",
61 .class = ACPI_AC_CLASS, 66 .class = ACPI_AC_CLASS,
62 .ids = ACPI_AC_HID, 67 .ids = ac_device_ids,
63 .ops = { 68 .ops = {
64 .add = acpi_ac_add, 69 .add = acpi_ac_add,
65 .remove = acpi_ac_remove, 70 .remove = acpi_ac_remove,
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index e65628a03085..5f1127ad5a95 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -53,10 +53,16 @@ static int acpi_memory_device_add(struct acpi_device *device);
53static int acpi_memory_device_remove(struct acpi_device *device, int type); 53static int acpi_memory_device_remove(struct acpi_device *device, int type);
54static int acpi_memory_device_start(struct acpi_device *device); 54static int acpi_memory_device_start(struct acpi_device *device);
55 55
56static const struct acpi_device_id memory_device_ids[] = {
57 {ACPI_MEMORY_DEVICE_HID, 0},
58 {"", 0},
59};
60MODULE_DEVICE_TABLE(acpi, memory_device_ids);
61
56static struct acpi_driver acpi_memory_device_driver = { 62static struct acpi_driver acpi_memory_device_driver = {
57 .name = "acpi_memhotplug", 63 .name = "acpi_memhotplug",
58 .class = ACPI_MEMORY_DEVICE_CLASS, 64 .class = ACPI_MEMORY_DEVICE_CLASS,
59 .ids = ACPI_MEMORY_DEVICE_HID, 65 .ids = memory_device_ids,
60 .ops = { 66 .ops = {
61 .add = acpi_memory_device_add, 67 .add = acpi_memory_device_add,
62 .remove = acpi_memory_device_remove, 68 .remove = acpi_memory_device_remove,
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index 3cd79caad70c..9c4bd220c44f 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -56,7 +56,6 @@
56#define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver" 56#define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver"
57#define ACPI_HOTK_CLASS "hotkey" 57#define ACPI_HOTK_CLASS "hotkey"
58#define ACPI_HOTK_DEVICE_NAME "Hotkey" 58#define ACPI_HOTK_DEVICE_NAME "Hotkey"
59#define ACPI_HOTK_HID "ATK0100"
60 59
61/* 60/*
62 * Some events we use, same for all Asus 61 * Some events we use, same for all Asus
@@ -426,14 +425,20 @@ static struct acpi_table_header *asus_info;
426static struct asus_hotk *hotk; 425static struct asus_hotk *hotk;
427 426
428/* 427/*
429 * The hotkey driver declaration 428 * The hotkey driver and autoloading declaration
430 */ 429 */
431static int asus_hotk_add(struct acpi_device *device); 430static int asus_hotk_add(struct acpi_device *device);
432static int asus_hotk_remove(struct acpi_device *device, int type); 431static int asus_hotk_remove(struct acpi_device *device, int type);
432static const struct acpi_device_id asus_device_ids[] = {
433 {"ATK0100", 0},
434 {"", 0},
435};
436MODULE_DEVICE_TABLE(acpi, asus_device_ids);
437
433static struct acpi_driver asus_hotk_driver = { 438static struct acpi_driver asus_hotk_driver = {
434 .name = "asus_acpi", 439 .name = "asus_acpi",
435 .class = ACPI_HOTK_CLASS, 440 .class = ACPI_HOTK_CLASS,
436 .ids = ACPI_HOTK_HID, 441 .ids = asus_device_ids,
437 .ops = { 442 .ops = {
438 .add = asus_hotk_add, 443 .add = asus_hotk_add,
439 .remove = asus_hotk_remove, 444 .remove = asus_hotk_remove,
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index cad932de383d..81651032791b 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -41,7 +41,6 @@
41 41
42#define ACPI_BATTERY_COMPONENT 0x00040000 42#define ACPI_BATTERY_COMPONENT 0x00040000
43#define ACPI_BATTERY_CLASS "battery" 43#define ACPI_BATTERY_CLASS "battery"
44#define ACPI_BATTERY_HID "PNP0C0A"
45#define ACPI_BATTERY_DEVICE_NAME "Battery" 44#define ACPI_BATTERY_DEVICE_NAME "Battery"
46#define ACPI_BATTERY_NOTIFY_STATUS 0x80 45#define ACPI_BATTERY_NOTIFY_STATUS 0x80
47#define ACPI_BATTERY_NOTIFY_INFO 0x81 46#define ACPI_BATTERY_NOTIFY_INFO 0x81
@@ -74,10 +73,16 @@ static int acpi_battery_add(struct acpi_device *device);
74static int acpi_battery_remove(struct acpi_device *device, int type); 73static int acpi_battery_remove(struct acpi_device *device, int type);
75static int acpi_battery_resume(struct acpi_device *device); 74static int acpi_battery_resume(struct acpi_device *device);
76 75
76static const struct acpi_device_id battery_device_ids[] = {
77 {"PNP0C0A", 0},
78 {"", 0},
79};
80MODULE_DEVICE_TABLE(acpi, battery_device_ids);
81
77static struct acpi_driver acpi_battery_driver = { 82static struct acpi_driver acpi_battery_driver = {
78 .name = "battery", 83 .name = "battery",
79 .class = ACPI_BATTERY_CLASS, 84 .class = ACPI_BATTERY_CLASS,
80 .ids = ACPI_BATTERY_HID, 85 .ids = battery_device_ids,
81 .ops = { 86 .ops = {
82 .add = acpi_battery_add, 87 .add = acpi_battery_add,
83 .resume = acpi_battery_resume, 88 .resume = acpi_battery_resume,
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index cb4110b50cd0..540581338ef5 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -66,6 +66,16 @@ MODULE_AUTHOR("Paul Diefenbaugh");
66MODULE_DESCRIPTION("ACPI Button Driver"); 66MODULE_DESCRIPTION("ACPI Button Driver");
67MODULE_LICENSE("GPL"); 67MODULE_LICENSE("GPL");
68 68
69static const struct acpi_device_id button_device_ids[] = {
70 {ACPI_BUTTON_HID_LID, 0},
71 {ACPI_BUTTON_HID_SLEEP, 0},
72 {ACPI_BUTTON_HID_SLEEPF, 0},
73 {ACPI_BUTTON_HID_POWER, 0},
74 {ACPI_BUTTON_HID_POWERF, 0},
75 {"", 0},
76};
77MODULE_DEVICE_TABLE(acpi, button_device_ids);
78
69static int acpi_button_add(struct acpi_device *device); 79static int acpi_button_add(struct acpi_device *device);
70static int acpi_button_remove(struct acpi_device *device, int type); 80static int acpi_button_remove(struct acpi_device *device, int type);
71static int acpi_button_info_open_fs(struct inode *inode, struct file *file); 81static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
@@ -74,7 +84,7 @@ static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
74static struct acpi_driver acpi_button_driver = { 84static struct acpi_driver acpi_button_driver = {
75 .name = "button", 85 .name = "button",
76 .class = ACPI_BUTTON_CLASS, 86 .class = ACPI_BUTTON_CLASS,
77 .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E", 87 .ids = button_device_ids,
78 .ops = { 88 .ops = {
79 .add = acpi_button_add, 89 .add = acpi_button_add,
80 .remove = acpi_button_remove, 90 .remove = acpi_button_remove,
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 0dd3bf7c0ed1..3c25ec7a1871 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -52,10 +52,18 @@ MODULE_LICENSE("GPL");
52static int acpi_container_add(struct acpi_device *device); 52static int acpi_container_add(struct acpi_device *device);
53static int acpi_container_remove(struct acpi_device *device, int type); 53static int acpi_container_remove(struct acpi_device *device, int type);
54 54
55static const struct acpi_device_id container_device_ids[] = {
56 {"ACPI0004", 0},
57 {"PNP0A05", 0},
58 {"PNP0A06", 0},
59 {"", 0},
60};
61MODULE_DEVICE_TABLE(acpi, container_device_ids);
62
55static struct acpi_driver acpi_container_driver = { 63static struct acpi_driver acpi_container_driver = {
56 .name = "container", 64 .name = "container",
57 .class = ACPI_CONTAINER_CLASS, 65 .class = ACPI_CONTAINER_CLASS,
58 .ids = "ACPI0004,PNP0A05,PNP0A06", 66 .ids = container_device_ids,
59 .ops = { 67 .ops = {
60 .add = acpi_container_add, 68 .add = acpi_container_add,
61 .remove = acpi_container_remove, 69 .remove = acpi_container_remove,
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 10e851021eca..469f3f57f881 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -41,7 +41,6 @@
41#include <acpi/actypes.h> 41#include <acpi/actypes.h>
42 42
43#define ACPI_EC_CLASS "embedded_controller" 43#define ACPI_EC_CLASS "embedded_controller"
44#define ACPI_EC_HID "PNP0C09"
45#define ACPI_EC_DEVICE_NAME "Embedded Controller" 44#define ACPI_EC_DEVICE_NAME "Embedded Controller"
46#define ACPI_EC_FILE_INFO "info" 45#define ACPI_EC_FILE_INFO "info"
47 46
@@ -82,10 +81,15 @@ static int acpi_ec_start(struct acpi_device *device);
82static int acpi_ec_stop(struct acpi_device *device, int type); 81static int acpi_ec_stop(struct acpi_device *device, int type);
83static int acpi_ec_add(struct acpi_device *device); 82static int acpi_ec_add(struct acpi_device *device);
84 83
84static const struct acpi_device_id ec_device_ids[] = {
85 {"PNP0C09", 0},
86 {"", 0},
87};
88
85static struct acpi_driver acpi_ec_driver = { 89static struct acpi_driver acpi_ec_driver = {
86 .name = "ec", 90 .name = "ec",
87 .class = ACPI_EC_CLASS, 91 .class = ACPI_EC_CLASS,
88 .ids = ACPI_EC_HID, 92 .ids = ec_device_ids,
89 .ops = { 93 .ops = {
90 .add = acpi_ec_add, 94 .add = acpi_ec_add,
91 .remove = acpi_ec_remove, 95 .remove = acpi_ec_remove,
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index ec655c539492..c81f6bdb68b8 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -50,10 +50,16 @@ static int acpi_fan_remove(struct acpi_device *device, int type);
50static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); 50static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
51static int acpi_fan_resume(struct acpi_device *device); 51static int acpi_fan_resume(struct acpi_device *device);
52 52
53static const struct acpi_device_id fan_device_ids[] = {
54 {"PNP0C0B", 0},
55 {"", 0},
56};
57MODULE_DEVICE_TABLE(acpi, fan_device_ids);
58
53static struct acpi_driver acpi_fan_driver = { 59static struct acpi_driver acpi_fan_driver = {
54 .name = "fan", 60 .name = "fan",
55 .class = ACPI_FAN_CLASS, 61 .class = ACPI_FAN_CLASS,
56 .ids = "PNP0C0B", 62 .ids = fan_device_ids,
57 .ops = { 63 .ops = {
58 .add = acpi_fan_add, 64 .add = acpi_fan_add,
59 .remove = acpi_fan_remove, 65 .remove = acpi_fan_remove,
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 3448edd61dc4..c9f526e55392 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -46,7 +46,6 @@
46#define _COMPONENT ACPI_PCI_COMPONENT 46#define _COMPONENT ACPI_PCI_COMPONENT
47ACPI_MODULE_NAME("pci_link"); 47ACPI_MODULE_NAME("pci_link");
48#define ACPI_PCI_LINK_CLASS "pci_irq_routing" 48#define ACPI_PCI_LINK_CLASS "pci_irq_routing"
49#define ACPI_PCI_LINK_HID "PNP0C0F"
50#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" 49#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link"
51#define ACPI_PCI_LINK_FILE_INFO "info" 50#define ACPI_PCI_LINK_FILE_INFO "info"
52#define ACPI_PCI_LINK_FILE_STATUS "state" 51#define ACPI_PCI_LINK_FILE_STATUS "state"
@@ -54,10 +53,16 @@ ACPI_MODULE_NAME("pci_link");
54static int acpi_pci_link_add(struct acpi_device *device); 53static int acpi_pci_link_add(struct acpi_device *device);
55static int acpi_pci_link_remove(struct acpi_device *device, int type); 54static int acpi_pci_link_remove(struct acpi_device *device, int type);
56 55
56static struct acpi_device_id link_device_ids[] = {
57 {"PNP0C0F", 0},
58 {"", 0},
59};
60MODULE_DEVICE_TABLE(acpi, link_device_ids);
61
57static struct acpi_driver acpi_pci_link_driver = { 62static struct acpi_driver acpi_pci_link_driver = {
58 .name = "pci_link", 63 .name = "pci_link",
59 .class = ACPI_PCI_LINK_CLASS, 64 .class = ACPI_PCI_LINK_CLASS,
60 .ids = ACPI_PCI_LINK_HID, 65 .ids = link_device_ids,
61 .ops = { 66 .ops = {
62 .add = acpi_pci_link_add, 67 .add = acpi_pci_link_add,
63 .remove = acpi_pci_link_remove, 68 .remove = acpi_pci_link_remove,
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index ad4145a37786..f14ff1ffab29 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -38,16 +38,21 @@
38#define _COMPONENT ACPI_PCI_COMPONENT 38#define _COMPONENT ACPI_PCI_COMPONENT
39ACPI_MODULE_NAME("pci_root"); 39ACPI_MODULE_NAME("pci_root");
40#define ACPI_PCI_ROOT_CLASS "pci_bridge" 40#define ACPI_PCI_ROOT_CLASS "pci_bridge"
41#define ACPI_PCI_ROOT_HID "PNP0A03"
42#define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" 41#define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge"
43static int acpi_pci_root_add(struct acpi_device *device); 42static int acpi_pci_root_add(struct acpi_device *device);
44static int acpi_pci_root_remove(struct acpi_device *device, int type); 43static int acpi_pci_root_remove(struct acpi_device *device, int type);
45static int acpi_pci_root_start(struct acpi_device *device); 44static int acpi_pci_root_start(struct acpi_device *device);
46 45
46static struct acpi_device_id root_device_ids[] = {
47 {"PNP0A03", 0},
48 {"", 0},
49};
50MODULE_DEVICE_TABLE(acpi, root_device_ids);
51
47static struct acpi_driver acpi_pci_root_driver = { 52static struct acpi_driver acpi_pci_root_driver = {
48 .name = "pci_root", 53 .name = "pci_root",
49 .class = ACPI_PCI_ROOT_CLASS, 54 .class = ACPI_PCI_ROOT_CLASS,
50 .ids = ACPI_PCI_ROOT_HID, 55 .ids = root_device_ids,
51 .ops = { 56 .ops = {
52 .add = acpi_pci_root_add, 57 .add = acpi_pci_root_add,
53 .remove = acpi_pci_root_remove, 58 .remove = acpi_pci_root_remove,
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 4ffecd179702..57b9a2998fd0 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -59,10 +59,16 @@ static int acpi_power_remove(struct acpi_device *device, int type);
59static int acpi_power_resume(struct acpi_device *device); 59static int acpi_power_resume(struct acpi_device *device);
60static int acpi_power_open_fs(struct inode *inode, struct file *file); 60static int acpi_power_open_fs(struct inode *inode, struct file *file);
61 61
62static struct acpi_device_id power_device_ids[] = {
63 {ACPI_POWER_HID, 0},
64 {"", 0},
65};
66MODULE_DEVICE_TABLE(acpi, power_device_ids);
67
62static struct acpi_driver acpi_power_driver = { 68static struct acpi_driver acpi_power_driver = {
63 .name = "power", 69 .name = "power",
64 .class = ACPI_POWER_CLASS, 70 .class = ACPI_POWER_CLASS,
65 .ids = ACPI_POWER_HID, 71 .ids = power_device_ids,
66 .ops = { 72 .ops = {
67 .add = acpi_power_add, 73 .add = acpi_power_add,
68 .remove = acpi_power_remove, 74 .remove = acpi_power_remove,
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 81aceb5da7c7..498422343f38 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -88,10 +88,16 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr);
88extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr); 88extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
89 89
90 90
91static const struct acpi_device_id processor_device_ids[] = {
92 {ACPI_PROCESSOR_HID, 0},
93 {"", 0},
94};
95MODULE_DEVICE_TABLE(acpi, processor_device_ids);
96
91static struct acpi_driver acpi_processor_driver = { 97static struct acpi_driver acpi_processor_driver = {
92 .name = "processor", 98 .name = "processor",
93 .class = ACPI_PROCESSOR_CLASS, 99 .class = ACPI_PROCESSOR_CLASS,
94 .ids = ACPI_PROCESSOR_HID, 100 .ids = processor_device_ids,
95 .ops = { 101 .ops = {
96 .add = acpi_processor_add, 102 .add = acpi_processor_add,
97 .remove = acpi_processor_remove, 103 .remove = acpi_processor_remove,
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 974d00ccfe84..7d8e78ea13a5 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -38,7 +38,6 @@
38#define ACPI_SBS_CLASS "sbs" 38#define ACPI_SBS_CLASS "sbs"
39#define ACPI_AC_CLASS "ac_adapter" 39#define ACPI_AC_CLASS "ac_adapter"
40#define ACPI_BATTERY_CLASS "battery" 40#define ACPI_BATTERY_CLASS "battery"
41#define ACPI_SBS_HID "ACPI0002"
42#define ACPI_SBS_DEVICE_NAME "Smart Battery System" 41#define ACPI_SBS_DEVICE_NAME "Smart Battery System"
43#define ACPI_SBS_FILE_INFO "info" 42#define ACPI_SBS_FILE_INFO "info"
44#define ACPI_SBS_FILE_STATE "state" 43#define ACPI_SBS_FILE_STATE "state"
@@ -124,10 +123,17 @@ static int acpi_sbs_add(struct acpi_device *device);
124static int acpi_sbs_remove(struct acpi_device *device, int type); 123static int acpi_sbs_remove(struct acpi_device *device, int type);
125static int acpi_sbs_resume(struct acpi_device *device); 124static int acpi_sbs_resume(struct acpi_device *device);
126 125
126static const struct acpi_device_id sbs_device_ids[] = {
127 {"ACPI0001", 0},
128 {"ACPI0005", 0},
129 {"", 0},
130};
131MODULE_DEVICE_TABLE(acpi, sbs_device_ids);
132
127static struct acpi_driver acpi_sbs_driver = { 133static struct acpi_driver acpi_sbs_driver = {
128 .name = "sbs", 134 .name = "sbs",
129 .class = ACPI_SBS_CLASS, 135 .class = ACPI_SBS_CLASS,
130 .ids = "ACPI0001,ACPI0005", 136 .ids = sbs_device_ids,
131 .ops = { 137 .ops = {
132 .add = acpi_sbs_add, 138 .add = acpi_sbs_add,
133 .remove = acpi_sbs_remove, 139 .remove = acpi_sbs_remove,
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 58f1338981bc..5a62de1b7f2a 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -92,10 +92,16 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file);
92static ssize_t acpi_thermal_write_polling(struct file *, const char __user *, 92static ssize_t acpi_thermal_write_polling(struct file *, const char __user *,
93 size_t, loff_t *); 93 size_t, loff_t *);
94 94
95static const struct acpi_device_id thermal_device_ids[] = {
96 {ACPI_THERMAL_HID, 0},
97 {"", 0},
98};
99MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
100
95static struct acpi_driver acpi_thermal_driver = { 101static struct acpi_driver acpi_thermal_driver = {
96 .name = "thermal", 102 .name = "thermal",
97 .class = ACPI_THERMAL_CLASS, 103 .class = ACPI_THERMAL_CLASS,
98 .ids = ACPI_THERMAL_HID, 104 .ids = thermal_device_ids,
99 .ops = { 105 .ops = {
100 .add = acpi_thermal_add, 106 .add = acpi_thermal_add,
101 .remove = acpi_thermal_remove, 107 .remove = acpi_thermal_remove,
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 04ea697f72bf..d98701941981 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -74,10 +74,16 @@ MODULE_LICENSE("GPL");
74static int acpi_video_bus_add(struct acpi_device *device); 74static int acpi_video_bus_add(struct acpi_device *device);
75static int acpi_video_bus_remove(struct acpi_device *device, int type); 75static int acpi_video_bus_remove(struct acpi_device *device, int type);
76 76
77static const struct acpi_device_id video_device_ids[] = {
78 {ACPI_VIDEO_HID, 0},
79 {"", 0},
80};
81MODULE_DEVICE_TABLE(acpi, video_device_ids);
82
77static struct acpi_driver acpi_video_bus = { 83static struct acpi_driver acpi_video_bus = {
78 .name = "video", 84 .name = "video",
79 .class = ACPI_VIDEO_CLASS, 85 .class = ACPI_VIDEO_CLASS,
80 .ids = ACPI_VIDEO_HID, 86 .ids = video_device_ids,
81 .ops = { 87 .ops = {
82 .add = acpi_video_bus_add, 88 .add = acpi_video_bus_add,
83 .remove = acpi_video_bus_remove, 89 .remove = acpi_video_bus_remove,
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index ba0e74ad74bb..9a2694e5f8b9 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -1007,9 +1007,15 @@ static int hpet_acpi_remove(struct acpi_device *device, int type)
1007 return -EINVAL; 1007 return -EINVAL;
1008} 1008}
1009 1009
1010static const struct acpi_device_id hpet_device_ids[] = {
1011 {"PNP0103", 0},
1012 {"", 0},
1013};
1014MODULE_DEVICE_TABLE(acpi, hpet_device_ids);
1015
1010static struct acpi_driver hpet_acpi_driver = { 1016static struct acpi_driver hpet_acpi_driver = {
1011 .name = "hpet", 1017 .name = "hpet",
1012 .ids = "PNP0103", 1018 .ids = hpet_device_ids,
1013 .ops = { 1019 .ops = {
1014 .add = hpet_acpi_add, 1020 .add = hpet_acpi_add,
1015 .remove = hpet_acpi_remove, 1021 .remove = hpet_acpi_remove,
diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c
index 0acc3a123604..e43e92fd9e23 100644
--- a/drivers/input/misc/atlas_btns.c
+++ b/drivers/input/misc/atlas_btns.c
@@ -31,7 +31,6 @@
31 31
32#define ACPI_ATLAS_NAME "Atlas ACPI" 32#define ACPI_ATLAS_NAME "Atlas ACPI"
33#define ACPI_ATLAS_CLASS "Atlas" 33#define ACPI_ATLAS_CLASS "Atlas"
34#define ACPI_ATLAS_BUTTON_HID "ASIM0000"
35 34
36static struct input_dev *input_dev; 35static struct input_dev *input_dev;
37 36
@@ -130,10 +129,16 @@ static int atlas_acpi_button_remove(struct acpi_device *device, int type)
130 return status; 129 return status;
131} 130}
132 131
132static const struct acpi_device_id atlas_device_ids[] = {
133 {"ASIM0000", 0},
134 {"", 0},
135};
136MODULE_DEVICE_TABLE(acpi, atlas_device_ids);
137
133static struct acpi_driver atlas_acpi_driver = { 138static struct acpi_driver atlas_acpi_driver = {
134 .name = ACPI_ATLAS_NAME, 139 .name = ACPI_ATLAS_NAME,
135 .class = ACPI_ATLAS_CLASS, 140 .class = ACPI_ATLAS_CLASS,
136 .ids = ACPI_ATLAS_BUTTON_HID, 141 .ids = atlas_device_ids,
137 .ops = { 142 .ops = {
138 .add = atlas_acpi_button_add, 143 .add = atlas_acpi_button_add,
139 .remove = atlas_acpi_button_remove, 144 .remove = atlas_acpi_button_remove,
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index f75306059971..63953fe03320 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -53,7 +53,6 @@
53#define ASUS_HOTK_NAME "Asus Laptop Support" 53#define ASUS_HOTK_NAME "Asus Laptop Support"
54#define ASUS_HOTK_CLASS "hotkey" 54#define ASUS_HOTK_CLASS "hotkey"
55#define ASUS_HOTK_DEVICE_NAME "Hotkey" 55#define ASUS_HOTK_DEVICE_NAME "Hotkey"
56#define ASUS_HOTK_HID "ATK0100"
57#define ASUS_HOTK_FILE "asus-laptop" 56#define ASUS_HOTK_FILE "asus-laptop"
58#define ASUS_HOTK_PREFIX "\\_SB.ATKD." 57#define ASUS_HOTK_PREFIX "\\_SB.ATKD."
59 58
@@ -197,12 +196,18 @@ static struct asus_hotk *hotk;
197/* 196/*
198 * The hotkey driver declaration 197 * The hotkey driver declaration
199 */ 198 */
199static const struct acpi_device_id asus_device_ids[] = {
200 {"ATK0100", 0},
201 {"", 0},
202};
203MODULE_DEVICE_TABLE(acpi, asus_device_ids);
204
200static int asus_hotk_add(struct acpi_device *device); 205static int asus_hotk_add(struct acpi_device *device);
201static int asus_hotk_remove(struct acpi_device *device, int type); 206static int asus_hotk_remove(struct acpi_device *device, int type);
202static struct acpi_driver asus_hotk_driver = { 207static struct acpi_driver asus_hotk_driver = {
203 .name = ASUS_HOTK_NAME, 208 .name = ASUS_HOTK_NAME,
204 .class = ASUS_HOTK_CLASS, 209 .class = ASUS_HOTK_CLASS,
205 .ids = ASUS_HOTK_HID, 210 .ids = asus_device_ids,
206 .ops = { 211 .ops = {
207 .add = asus_hotk_add, 212 .add = asus_hotk_add,
208 .remove = asus_hotk_remove, 213 .remove = asus_hotk_remove,
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 303e48ca0e8a..14ee06c8f127 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -1124,10 +1124,22 @@ static int sony_nc_remove(struct acpi_device *device, int type)
1124 return 0; 1124 return 0;
1125} 1125}
1126 1126
1127static const struct acpi_device_id sony_device_ids[] = {
1128 {SONY_NC_HID, 0},
1129 {SONY_PIC_HID, 0},
1130 {"", 0},
1131};
1132MODULE_DEVICE_TABLE(acpi, sony_device_ids);
1133
1134static const struct acpi_device_id sony_nc_device_ids[] = {
1135 {SONY_NC_HID, 0},
1136 {"", 0},
1137};
1138
1127static struct acpi_driver sony_nc_driver = { 1139static struct acpi_driver sony_nc_driver = {
1128 .name = SONY_NC_DRIVER_NAME, 1140 .name = SONY_NC_DRIVER_NAME,
1129 .class = SONY_NC_CLASS, 1141 .class = SONY_NC_CLASS,
1130 .ids = SONY_NC_HID, 1142 .ids = sony_nc_device_ids,
1131 .owner = THIS_MODULE, 1143 .owner = THIS_MODULE,
1132 .ops = { 1144 .ops = {
1133 .add = sony_nc_add, 1145 .add = sony_nc_add,
@@ -2470,10 +2482,15 @@ static int sony_pic_resume(struct acpi_device *device)
2470 return 0; 2482 return 0;
2471} 2483}
2472 2484
2485static const struct acpi_device_id sony_pic_device_ids[] = {
2486 {SONY_PIC_HID, 0},
2487 {"", 0},
2488};
2489
2473static struct acpi_driver sony_pic_driver = { 2490static struct acpi_driver sony_pic_driver = {
2474 .name = SONY_PIC_DRIVER_NAME, 2491 .name = SONY_PIC_DRIVER_NAME,
2475 .class = SONY_PIC_CLASS, 2492 .class = SONY_PIC_CLASS,
2476 .ids = SONY_PIC_HID, 2493 .ids = sony_pic_device_ids,
2477 .owner = THIS_MODULE, 2494 .owner = THIS_MODULE,
2478 .ops = { 2495 .ops = {
2479 .add = sony_pic_add, 2496 .add = sony_pic_add,
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index f15a58f7403f..fa80f355e522 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -411,12 +411,13 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
411 411
412 sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name); 412 sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name);
413 ibm->acpi->driver->ids = ibm->acpi->hid; 413 ibm->acpi->driver->ids = ibm->acpi->hid;
414
414 ibm->acpi->driver->ops.add = &tpacpi_device_add; 415 ibm->acpi->driver->ops.add = &tpacpi_device_add;
415 416
416 rc = acpi_bus_register_driver(ibm->acpi->driver); 417 rc = acpi_bus_register_driver(ibm->acpi->driver);
417 if (rc < 0) { 418 if (rc < 0) {
418 printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n", 419 printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n",
419 ibm->acpi->hid, rc); 420 ibm->name, rc);
420 kfree(ibm->acpi->driver); 421 kfree(ibm->acpi->driver);
421 ibm->acpi->driver = NULL; 422 ibm->acpi->driver = NULL;
422 } else if (!rc) 423 } else if (!rc)
@@ -1316,8 +1317,13 @@ errexit:
1316 return res; 1317 return res;
1317} 1318}
1318 1319
1320static const struct acpi_device_id ibm_htk_device_ids[] = {
1321 {IBM_HKEY_HID, 0},
1322 {"", 0},
1323};
1324
1319static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = { 1325static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = {
1320 .hid = IBM_HKEY_HID, 1326 .hid = ibm_htk_device_ids,
1321 .notify = hotkey_notify, 1327 .notify = hotkey_notify,
1322 .handle = &hkey_handle, 1328 .handle = &hkey_handle,
1323 .type = ACPI_DEVICE_NOTIFY, 1329 .type = ACPI_DEVICE_NOTIFY,
@@ -2080,6 +2086,11 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
2080/* don't list other alternatives as we install a notify handler on the 570 */ 2086/* don't list other alternatives as we install a notify handler on the 570 */
2081IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ 2087IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
2082 2088
2089static const struct acpi_device_id ibm_pci_device_ids[] = {
2090 {PCI_ROOT_HID_STRING, 0},
2091 {"", 0},
2092};
2093
2083static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { 2094static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = {
2084 { 2095 {
2085 .notify = dock_notify, 2096 .notify = dock_notify,
@@ -2090,7 +2101,7 @@ static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = {
2090 /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING. 2101 /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING.
2091 * We just use it to get notifications of dock hotplug 2102 * We just use it to get notifications of dock hotplug
2092 * in very old thinkpads */ 2103 * in very old thinkpads */
2093 .hid = PCI_ROOT_HID_STRING, 2104 .hid = ibm_pci_device_ids,
2094 .notify = dock_notify, 2105 .notify = dock_notify,
2095 .handle = &pci_handle, 2106 .handle = &pci_handle,
2096 .type = ACPI_SYSTEM_NOTIFY, 2107 .type = ACPI_SYSTEM_NOTIFY,
@@ -2149,7 +2160,8 @@ static int __init dock_init2(struct ibm_init_struct *iibm)
2149static void dock_notify(struct ibm_struct *ibm, u32 event) 2160static void dock_notify(struct ibm_struct *ibm, u32 event)
2150{ 2161{
2151 int docked = dock_docked(); 2162 int docked = dock_docked();
2152 int pci = ibm->acpi->hid && strstr(ibm->acpi->hid, PCI_ROOT_HID_STRING); 2163 int pci = ibm->acpi->hid && ibm->acpi->device &&
2164 acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids);
2153 2165
2154 if (event == 1 && !pci) /* 570 */ 2166 if (event == 1 && !pci) /* 570 */
2155 acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ 2167 acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index b7a4a888cc8b..88af089d6494 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -193,7 +193,7 @@ static void thinkpad_acpi_module_exit(void);
193struct ibm_struct; 193struct ibm_struct;
194 194
195struct tp_acpi_drv_struct { 195struct tp_acpi_drv_struct {
196 char *hid; 196 const struct acpi_device_id *hid;
197 struct acpi_driver *driver; 197 struct acpi_driver *driver;
198 198
199 void (*notify) (struct ibm_struct *, u32); 199 void (*notify) (struct ibm_struct *, u32);