aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-07-25 01:36:53 -0400
committerLen Brown <len.brown@intel.com>2007-07-25 01:36:53 -0400
commit323ef30af3a0da47cc761b04b262d98d0fe79126 (patch)
tree37636b25acc557969aee51f1fe3e3cbc7a9760ea
parentcb3e0c107bebc6cf3e7158f7aa54c32017c7d4c4 (diff)
parent1ba90e3a87c46500623afdc3898573e4a5ebb21b (diff)
Pull auto-load-modules into release branch
-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/events/evrgnini.c2
-rw-r--r--drivers/acpi/fan.c8
-rw-r--r--drivers/acpi/namespace/nsxfeval.c2
-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/scan.c156
-rw-r--r--drivers/acpi/thermal.c8
-rw-r--r--drivers/acpi/utilities/uteval.c4
-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
-rw-r--r--drivers/pnp/pnpacpi/core.c19
-rw-r--r--include/acpi/acpi_bus.h5
-rw-r--r--include/acpi/acpi_drivers.h21
-rw-r--r--include/acpi/actypes.h6
-rw-r--r--include/acpi/acutils.h4
-rw-r--r--include/linux/acpi.h1
-rw-r--r--include/linux/mod_devicetable.h6
-rw-r--r--scripts/mod/file2alias.c12
33 files changed, 336 insertions, 106 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/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index 23ee7bc4a705..b1aaa0e84588 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -378,7 +378,7 @@ static u8 acpi_ev_match_pci_root_bridge(char *id)
378static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) 378static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
379{ 379{
380 acpi_status status; 380 acpi_status status;
381 struct acpi_device_id hid; 381 struct acpica_device_id hid;
382 struct acpi_compatible_id_list *cid; 382 struct acpi_compatible_id_list *cid;
383 acpi_native_uint i; 383 acpi_native_uint i;
384 384
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/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index be4f2899de74..ab65b2c2560e 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -440,7 +440,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
440 acpi_status status; 440 acpi_status status;
441 struct acpi_namespace_node *node; 441 struct acpi_namespace_node *node;
442 u32 flags; 442 u32 flags;
443 struct acpi_device_id hid; 443 struct acpica_device_id hid;
444 struct acpi_compatible_id_list *cid; 444 struct acpi_compatible_id_list *cid;
445 acpi_native_uint i; 445 acpi_native_uint i;
446 446
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/scan.c b/drivers/acpi/scan.c
index 6b3b8a522476..be74347d1354 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -16,7 +16,7 @@ ACPI_MODULE_NAME("scan");
16extern struct acpi_device *acpi_root; 16extern struct acpi_device *acpi_root;
17 17
18#define ACPI_BUS_CLASS "system_bus" 18#define ACPI_BUS_CLASS "system_bus"
19#define ACPI_BUS_HID "ACPI_BUS" 19#define ACPI_BUS_HID "LNXSYBUS"
20#define ACPI_BUS_DEVICE_NAME "System Bus" 20#define ACPI_BUS_DEVICE_NAME "System Bus"
21 21
22static LIST_HEAD(acpi_device_list); 22static LIST_HEAD(acpi_device_list);
@@ -29,6 +29,62 @@ struct acpi_device_bus_id{
29 unsigned int instance_no; 29 unsigned int instance_no;
30 struct list_head node; 30 struct list_head node;
31}; 31};
32
33/*
34 * Creates hid/cid(s) string needed for modalias and uevent
35 * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get:
36 * char *modalias: "acpi:IBM0001:ACPI0001"
37*/
38int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){
39
40 int len;
41
42 if (!acpi_dev->flags.hardware_id)
43 return -ENODEV;
44
45 len = snprintf(modalias, size, "acpi:%s:",
46 acpi_dev->pnp.hardware_id);
47 if (len < 0 || len >= size)
48 return -EINVAL;
49 size -= len;
50
51 if (acpi_dev->flags.compatible_ids) {
52 struct acpi_compatible_id_list *cid_list;
53 int i;
54 int count;
55
56 cid_list = acpi_dev->pnp.cid_list;
57 for (i = 0; i < cid_list->count; i++) {
58 count = snprintf(&modalias[len], size, "%s:",
59 cid_list->id[i].value);
60 if (count < 0 || count >= size) {
61 printk(KERN_ERR "acpi: %s cid[%i] exceeds event buffer size",
62 acpi_dev->pnp.device_name, i);
63 break;
64 }
65 len += count;
66 size -= count;
67 }
68 }
69
70 modalias[len] = '\0';
71 return len;
72}
73
74static ssize_t
75acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf) {
76 struct acpi_device *acpi_dev = to_acpi_device(dev);
77 int len;
78
79 /* Device has no HID and no CID or string is >1024 */
80 len = create_modalias(acpi_dev, buf, 1024);
81 if (len <= 0)
82 return 0;
83 buf[len++] = '\n';
84 return len;
85}
86static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
87
32static int acpi_eject_operation(acpi_handle handle, int lockable) 88static int acpi_eject_operation(acpi_handle handle, int lockable)
33{ 89{
34 struct acpi_object_list arg_list; 90 struct acpi_object_list arg_list;
@@ -154,6 +210,12 @@ static int acpi_device_setup_files(struct acpi_device *dev)
154 goto end; 210 goto end;
155 } 211 }
156 212
213 if (dev->flags.hardware_id || dev->flags.compatible_ids){
214 result = device_create_file(&dev->dev, &dev_attr_modalias);
215 if(result)
216 goto end;
217 }
218
157 /* 219 /*
158 * If device has _EJ0, 'eject' file is created that is used to trigger 220 * If device has _EJ0, 'eject' file is created that is used to trigger
159 * hot-removal function from userland. 221 * hot-removal function from userland.
@@ -178,6 +240,9 @@ static void acpi_device_remove_files(struct acpi_device *dev)
178 if (ACPI_SUCCESS(status)) 240 if (ACPI_SUCCESS(status))
179 device_remove_file(&dev->dev, &dev_attr_eject); 241 device_remove_file(&dev->dev, &dev_attr_eject);
180 242
243 if (dev->flags.hardware_id || dev->flags.compatible_ids)
244 device_remove_file(&dev->dev, &dev_attr_modalias);
245
181 if(dev->flags.hardware_id) 246 if(dev->flags.hardware_id)
182 device_remove_file(&dev->dev, &dev_attr_hid); 247 device_remove_file(&dev->dev, &dev_attr_hid);
183 if(dev->handle) 248 if(dev->handle)
@@ -186,6 +251,37 @@ static void acpi_device_remove_files(struct acpi_device *dev)
186/* -------------------------------------------------------------------------- 251/* --------------------------------------------------------------------------
187 ACPI Bus operations 252 ACPI Bus operations
188 -------------------------------------------------------------------------- */ 253 -------------------------------------------------------------------------- */
254
255int acpi_match_device_ids(struct acpi_device *device,
256 const struct acpi_device_id *ids)
257{
258 const struct acpi_device_id *id;
259
260 if (device->flags.hardware_id) {
261 for (id = ids; id->id[0]; id++) {
262 if (!strcmp((char*)id->id, device->pnp.hardware_id))
263 return 0;
264 }
265 }
266
267 if (device->flags.compatible_ids) {
268 struct acpi_compatible_id_list *cid_list = device->pnp.cid_list;
269 int i;
270
271 for (id = ids; id->id[0]; id++) {
272 /* compare multiple _CID entries against driver ids */
273 for (i = 0; i < cid_list->count; i++) {
274 if (!strcmp((char*)id->id,
275 cid_list->id[i].value))
276 return 0;
277 }
278 }
279 }
280
281 return -ENOENT;
282}
283EXPORT_SYMBOL(acpi_match_device_ids);
284
189static void acpi_device_release(struct device *dev) 285static void acpi_device_release(struct device *dev)
190{ 286{
191 struct acpi_device *acpi_dev = to_acpi_device(dev); 287 struct acpi_device *acpi_dev = to_acpi_device(dev);
@@ -219,37 +315,19 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv)
219 struct acpi_device *acpi_dev = to_acpi_device(dev); 315 struct acpi_device *acpi_dev = to_acpi_device(dev);
220 struct acpi_driver *acpi_drv = to_acpi_driver(drv); 316 struct acpi_driver *acpi_drv = to_acpi_driver(drv);
221 317
222 return !acpi_match_ids(acpi_dev, acpi_drv->ids); 318 return !acpi_match_device_ids(acpi_dev, acpi_drv->ids);
223} 319}
224 320
225static int acpi_device_uevent(struct device *dev, char **envp, int num_envp, 321static int acpi_device_uevent(struct device *dev, char **envp, int num_envp,
226 char *buffer, int buffer_size) 322 char *buffer, int buffer_size)
227{ 323{
228 struct acpi_device *acpi_dev = to_acpi_device(dev); 324 struct acpi_device *acpi_dev = to_acpi_device(dev);
229 int i = 0, length = 0, ret = 0;
230
231 if (acpi_dev->flags.hardware_id)
232 ret = add_uevent_var(envp, num_envp, &i,
233 buffer, buffer_size, &length,
234 "HWID=%s", acpi_dev->pnp.hardware_id);
235 if (ret)
236 return -ENOMEM;
237 if (acpi_dev->flags.compatible_ids) {
238 int j;
239 struct acpi_compatible_id_list *cid_list;
240 325
241 cid_list = acpi_dev->pnp.cid_list; 326 strcpy(buffer, "MODALIAS=");
242 327 if (create_modalias(acpi_dev, buffer + 9, buffer_size - 9) > 0) {
243 for (j = 0; j < cid_list->count; j++) { 328 envp[0] = buffer;
244 ret = add_uevent_var(envp, num_envp, &i, buffer, 329 envp[1] = NULL;
245 buffer_size, &length, "COMPTID=%s",
246 cid_list->id[j].value);
247 if (ret)
248 return -ENOMEM;
249 }
250 } 330 }
251
252 envp[i] = NULL;
253 return 0; 331 return 0;
254} 332}
255 333
@@ -543,25 +621,6 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context)
543 return; 621 return;
544} 622}
545 623
546int acpi_match_ids(struct acpi_device *device, char *ids)
547{
548 if (device->flags.hardware_id)
549 if (strstr(ids, device->pnp.hardware_id))
550 return 0;
551
552 if (device->flags.compatible_ids) {
553 struct acpi_compatible_id_list *cid_list = device->pnp.cid_list;
554 int i;
555
556 /* compare multiple _CID entries against driver ids */
557 for (i = 0; i < cid_list->count; i++) {
558 if (strstr(ids, cid_list->id[i].value))
559 return 0;
560 }
561 }
562 return -ENOENT;
563}
564
565static int acpi_bus_get_perf_flags(struct acpi_device *device) 624static int acpi_bus_get_perf_flags(struct acpi_device *device)
566{ 625{
567 device->performance.state = ACPI_STATE_UNKNOWN; 626 device->performance.state = ACPI_STATE_UNKNOWN;
@@ -624,6 +683,13 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
624 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 683 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
625 union acpi_object *package = NULL; 684 union acpi_object *package = NULL;
626 685
686 struct acpi_device_id button_device_ids[] = {
687 {"PNP0C0D", 0},
688 {"PNP0C0C", 0},
689 {"PNP0C0E", 0},
690 {"", 0},
691 };
692
627 693
628 /* _PRW */ 694 /* _PRW */
629 status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); 695 status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);
@@ -643,7 +709,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
643 709
644 device->wakeup.flags.valid = 1; 710 device->wakeup.flags.valid = 1;
645 /* Power button, Lid switch always enable wakeup */ 711 /* Power button, Lid switch always enable wakeup */
646 if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E")) 712 if (!acpi_match_device_ids(device, button_device_ids))
647 device->wakeup.flags.run_wake = 1; 713 device->wakeup.flags.run_wake = 1;
648 714
649 end: 715 end:
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/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index f112af433e36..0042b7e78b26 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -407,7 +407,7 @@ acpi_ut_copy_id_string(char *destination, char *source, acpi_size max_length)
407 407
408acpi_status 408acpi_status
409acpi_ut_execute_HID(struct acpi_namespace_node *device_node, 409acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
410 struct acpi_device_id *hid) 410 struct acpica_device_id *hid)
411{ 411{
412 union acpi_operand_object *obj_desc; 412 union acpi_operand_object *obj_desc;
413 acpi_status status; 413 acpi_status status;
@@ -609,7 +609,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node,
609 609
610acpi_status 610acpi_status
611acpi_ut_execute_UID(struct acpi_namespace_node *device_node, 611acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
612 struct acpi_device_id *uid) 612 struct acpica_device_id *uid)
613{ 613{
614 union acpi_operand_object *obj_desc; 614 union acpi_operand_object *obj_desc;
615 acpi_status status; 615 acpi_status status;
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 6b89854bd3ff..d0fc4fd212e6 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);
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index c37a558ecd96..fcd32ac575c3 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -21,7 +21,10 @@
21 21
22#include <linux/acpi.h> 22#include <linux/acpi.h>
23#include <linux/pnp.h> 23#include <linux/pnp.h>
24#include <linux/mod_devicetable.h>
24#include <acpi/acpi_bus.h> 25#include <acpi/acpi_bus.h>
26#include <acpi/actypes.h>
27
25#include "pnpacpi.h" 28#include "pnpacpi.h"
26 29
27static int num = 0; 30static int num = 0;
@@ -33,15 +36,17 @@ static int num = 0;
33 * have irqs (PIC, Timer) because we call acpi_register_gsi. 36 * have irqs (PIC, Timer) because we call acpi_register_gsi.
34 * Finaly only devices that have a CRS method need to be in this list. 37 * Finaly only devices that have a CRS method need to be in this list.
35 */ 38 */
36static char __initdata excluded_id_list[] = 39static __initdata struct acpi_device_id excluded_id_list[] ={
37 "PNP0C09," /* EC */ 40 {"PNP0C09", 0}, /* EC */
38 "PNP0C0F," /* Link device */ 41 {"PNP0C0F", 0}, /* Link device */
39 "PNP0000," /* PIC */ 42 {"PNP0000", 0}, /* PIC */
40 "PNP0100," /* Timer */ 43 {"PNP0100", 0}, /* Timer */
41 ; 44 {"", 0},
45};
46
42static inline int is_exclusive_device(struct acpi_device *dev) 47static inline int is_exclusive_device(struct acpi_device *dev)
43{ 48{
44 return (!acpi_match_ids(dev, excluded_id_list)); 49 return (!acpi_match_device_ids(dev, excluded_id_list));
45} 50}
46 51
47/* 52/*
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index a9f73efa01bc..533ef40f7ccf 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -131,7 +131,7 @@ struct acpi_device_ops {
131struct acpi_driver { 131struct acpi_driver {
132 char name[80]; 132 char name[80];
133 char class[80]; 133 char class[80];
134 char *ids; /* Supported Hardware IDs */ 134 const struct acpi_device_id *ids; /* Supported Hardware IDs */
135 struct acpi_device_ops ops; 135 struct acpi_device_ops ops;
136 struct device_driver drv; 136 struct device_driver drv;
137 struct module *owner; 137 struct module *owner;
@@ -341,7 +341,8 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
341int acpi_bus_trim(struct acpi_device *start, int rmdevice); 341int acpi_bus_trim(struct acpi_device *start, int rmdevice);
342int acpi_bus_start(struct acpi_device *device); 342int acpi_bus_start(struct acpi_device *device);
343acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); 343acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
344int acpi_match_ids(struct acpi_device *device, char *ids); 344int acpi_match_device_ids(struct acpi_device *device,
345 const struct acpi_device_id *ids);
345int acpi_create_dir(struct acpi_device *); 346int acpi_create_dir(struct acpi_device *);
346void acpi_remove_dir(struct acpi_device *); 347void acpi_remove_dir(struct acpi_device *);
347 348
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 07b5d76b92cc..f85f77a538aa 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -34,16 +34,21 @@
34#define ACPI_BUS_COMPONENT 0x00010000 34#define ACPI_BUS_COMPONENT 0x00010000
35#define ACPI_SYSTEM_COMPONENT 0x02000000 35#define ACPI_SYSTEM_COMPONENT 0x02000000
36 36
37/* _HID definitions */ 37/*
38 * _HID definitions
39 * HIDs must conform to ACPI spec(6.1.4)
40 * Linux specific HIDs do not apply to this and begin with LNX:
41 */
38 42
39#define ACPI_POWER_HID "power_resource" 43#define ACPI_POWER_HID "LNXPOWER"
40#define ACPI_PROCESSOR_HID "ACPI0007" 44#define ACPI_PROCESSOR_HID "ACPI0007"
41#define ACPI_SYSTEM_HID "acpi_system" 45#define ACPI_SYSTEM_HID "LNXSYSTM"
42#define ACPI_THERMAL_HID "thermal" 46#define ACPI_THERMAL_HID "LNXTHERM"
43#define ACPI_BUTTON_HID_POWERF "button_power" 47#define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
44#define ACPI_BUTTON_HID_SLEEPF "button_sleep" 48#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
45#define ACPI_VIDEO_HID "video" 49#define ACPI_VIDEO_HID "LNXVIDEO"
46#define ACPI_BAY_HID "bay" 50#define ACPI_BAY_HID "LNXIOBAY"
51
47/* -------------------------------------------------------------------------- 52/* --------------------------------------------------------------------------
48 PCI 53 PCI
49 -------------------------------------------------------------------------- */ 54 -------------------------------------------------------------------------- */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index fe8abc276437..e73a38939120 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
809 809
810/* Common string version of device HIDs and UIDs */ 810/* Common string version of device HIDs and UIDs */
811 811
812struct acpi_device_id { 812struct acpica_device_id {
813 char value[ACPI_DEVICE_ID_LENGTH]; 813 char value[ACPI_DEVICE_ID_LENGTH];
814}; 814};
815 815
@@ -859,8 +859,8 @@ struct acpi_device_info {
859 u32 valid; /* Indicates which fields below are valid */ 859 u32 valid; /* Indicates which fields below are valid */
860 u32 current_status; /* _STA value */ 860 u32 current_status; /* _STA value */
861 acpi_integer address; /* _ADR value if any */ 861 acpi_integer address; /* _ADR value if any */
862 struct acpi_device_id hardware_id; /* _HID value if any */ 862 struct acpica_device_id hardware_id; /* _HID value if any */
863 struct acpi_device_id unique_id; /* _UID value if any */ 863 struct acpica_device_id unique_id; /* _UID value if any */
864 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ 864 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
865 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ 865 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
866}; 866};
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index a87ef1c8d46b..a2918547c73f 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name,
354 354
355acpi_status 355acpi_status
356acpi_ut_execute_HID(struct acpi_namespace_node *device_node, 356acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
357 struct acpi_device_id *hid); 357 struct acpica_device_id *hid);
358 358
359acpi_status 359acpi_status
360acpi_ut_execute_CID(struct acpi_namespace_node *device_node, 360acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
@@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node,
366 366
367acpi_status 367acpi_status
368acpi_ut_execute_UID(struct acpi_namespace_node *device_node, 368acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
369 struct acpi_device_id *uid); 369 struct acpica_device_id *uid);
370 370
371acpi_status 371acpi_status
372acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); 372acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d5680cd7746a..bf5e0009de75 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -33,6 +33,7 @@
33#endif 33#endif
34 34
35#include <linux/list.h> 35#include <linux/list.h>
36#include <linux/mod_devicetable.h>
36 37
37#include <acpi/acpi.h> 38#include <acpi/acpi.h>
38#include <acpi/acpi_bus.h> 39#include <acpi/acpi_bus.h>
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index af04a555b52c..2ada8ee316b3 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -159,6 +159,12 @@ struct ap_device_id {
159 159
160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01
161 161
162#define ACPI_ID_LEN 9
163
164struct acpi_device_id {
165 __u8 id[ACPI_ID_LEN];
166 kernel_ulong_t driver_data;
167};
162 168
163#define PNP_ID_LEN 8 169#define PNP_ID_LEN 8
164#define PNP_MAX_DEVICES 8 170#define PNP_MAX_DEVICES 8
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index f646381dc015..8a09021d8c59 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -290,6 +290,14 @@ static int do_serio_entry(const char *filename,
290 return 1; 290 return 1;
291} 291}
292 292
293/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */
294static int do_acpi_entry(const char *filename,
295 struct acpi_device_id *id, char *alias)
296{
297 sprintf(alias, "acpi*:%s:", id->id);
298 return 1;
299}
300
293/* looks like: "pnp:dD" */ 301/* looks like: "pnp:dD" */
294static int do_pnp_entry(const char *filename, 302static int do_pnp_entry(const char *filename,
295 struct pnp_device_id *id, char *alias) 303 struct pnp_device_id *id, char *alias)
@@ -551,6 +559,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
551 do_table(symval, sym->st_size, 559 do_table(symval, sym->st_size,
552 sizeof(struct serio_device_id), "serio", 560 sizeof(struct serio_device_id), "serio",
553 do_serio_entry, mod); 561 do_serio_entry, mod);
562 else if (sym_is(symname, "__mod_acpi_device_table"))
563 do_table(symval, sym->st_size,
564 sizeof(struct acpi_device_id), "acpi",
565 do_acpi_entry, mod);
554 else if (sym_is(symname, "__mod_pnp_device_table")) 566 else if (sym_is(symname, "__mod_pnp_device_table"))
555 do_table(symval, sym->st_size, 567 do_table(symval, sym->st_size,
556 sizeof(struct pnp_device_id), "pnp", 568 sizeof(struct pnp_device_id), "pnp",