diff options
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 20 |
1 files changed, 16 insertions, 4 deletions
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 */ |