aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/thinkpad_acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r--drivers/misc/thinkpad_acpi.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index f6cd34a3dbac..d0825a34a7b0 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2162,22 +2162,27 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
2162 int docked = dock_docked(); 2162 int docked = dock_docked();
2163 int pci = ibm->acpi->hid && ibm->acpi->device && 2163 int pci = ibm->acpi->hid && ibm->acpi->device &&
2164 acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids); 2164 acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids);
2165 int data;
2165 2166
2166 if (event == 1 && !pci) /* 570 */ 2167 if (event == 1 && !pci) /* 570 */
2167 acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ 2168 data = 1; /* button */
2168 else if (event == 1 && pci) /* 570 */ 2169 else if (event == 1 && pci) /* 570 */
2169 acpi_bus_generate_event(ibm->acpi->device, event, 3); /* dock */ 2170 data = 3; /* dock */
2170 else if (event == 3 && docked) 2171 else if (event == 3 && docked)
2171 acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ 2172 data = 1; /* button */
2172 else if (event == 3 && !docked) 2173 else if (event == 3 && !docked)
2173 acpi_bus_generate_event(ibm->acpi->device, event, 2); /* undock */ 2174 data = 2; /* undock */
2174 else if (event == 0 && docked) 2175 else if (event == 0 && docked)
2175 acpi_bus_generate_event(ibm->acpi->device, event, 3); /* dock */ 2176 data = 3; /* dock */
2176 else { 2177 else {
2177 printk(IBM_ERR "unknown dock event %d, status %d\n", 2178 printk(IBM_ERR "unknown dock event %d, status %d\n",
2178 event, _sta(dock_handle)); 2179 event, _sta(dock_handle));
2179 acpi_bus_generate_event(ibm->acpi->device, event, 0); /* unknown */ 2180 data = 0; /* unknown */
2180 } 2181 }
2182 acpi_bus_generate_event(ibm->acpi->device, event, data);
2183 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
2184 ibm->acpi->device->dev.bus_id,
2185 event, data);
2181} 2186}
2182 2187
2183static int dock_read(char *p) 2188static int dock_read(char *p)
@@ -2276,6 +2281,9 @@ static int __init bay_init(struct ibm_init_struct *iibm)
2276static void bay_notify(struct ibm_struct *ibm, u32 event) 2281static void bay_notify(struct ibm_struct *ibm, u32 event)
2277{ 2282{
2278 acpi_bus_generate_event(ibm->acpi->device, event, 0); 2283 acpi_bus_generate_event(ibm->acpi->device, event, 0);
2284 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
2285 ibm->acpi->device->dev.bus_id,
2286 event, 0);
2279} 2287}
2280 2288
2281#define bay_occupied(b) (_sta(b##_handle) & 1) 2289#define bay_occupied(b) (_sta(b##_handle) & 1)