diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/asus-laptop.c | 9 | ||||
-rw-r--r-- | drivers/misc/sony-laptop.c | 21 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 20 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.h | 2 |
4 files changed, 43 insertions, 9 deletions
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 | */ |
199 | static const struct acpi_device_id asus_device_ids[] = { | ||
200 | {"ATK0100", 0}, | ||
201 | {"", 0}, | ||
202 | }; | ||
203 | MODULE_DEVICE_TABLE(acpi, asus_device_ids); | ||
204 | |||
200 | static int asus_hotk_add(struct acpi_device *device); | 205 | static int asus_hotk_add(struct acpi_device *device); |
201 | static int asus_hotk_remove(struct acpi_device *device, int type); | 206 | static int asus_hotk_remove(struct acpi_device *device, int type); |
202 | static struct acpi_driver asus_hotk_driver = { | 207 | static 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 | ||
1127 | static const struct acpi_device_id sony_device_ids[] = { | ||
1128 | {SONY_NC_HID, 0}, | ||
1129 | {SONY_PIC_HID, 0}, | ||
1130 | {"", 0}, | ||
1131 | }; | ||
1132 | MODULE_DEVICE_TABLE(acpi, sony_device_ids); | ||
1133 | |||
1134 | static const struct acpi_device_id sony_nc_device_ids[] = { | ||
1135 | {SONY_NC_HID, 0}, | ||
1136 | {"", 0}, | ||
1137 | }; | ||
1138 | |||
1127 | static struct acpi_driver sony_nc_driver = { | 1139 | static 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 | ||
2485 | static const struct acpi_device_id sony_pic_device_ids[] = { | ||
2486 | {SONY_PIC_HID, 0}, | ||
2487 | {"", 0}, | ||
2488 | }; | ||
2489 | |||
2473 | static struct acpi_driver sony_pic_driver = { | 2490 | static 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 | ||
1320 | static const struct acpi_device_id ibm_htk_device_ids[] = { | ||
1321 | {IBM_HKEY_HID, 0}, | ||
1322 | {"", 0}, | ||
1323 | }; | ||
1324 | |||
1319 | static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = { | 1325 | static 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 */ |
2081 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ | 2087 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ |
2082 | 2088 | ||
2089 | static const struct acpi_device_id ibm_pci_device_ids[] = { | ||
2090 | {PCI_ROOT_HID_STRING, 0}, | ||
2091 | {"", 0}, | ||
2092 | }; | ||
2093 | |||
2083 | static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { | 2094 | static 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) | |||
2149 | static void dock_notify(struct ibm_struct *ibm, u32 event) | 2160 | static 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); | |||
193 | struct ibm_struct; | 193 | struct ibm_struct; |
194 | 194 | ||
195 | struct tp_acpi_drv_struct { | 195 | struct 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); |