Avoid beyond bounds copy while caching ACL
[zen-stable.git] / drivers / platform / x86 / dell-laptop.c
blob1d3bcce6fbdf208b0a03cdd2573fab7b45d272e0
1 /*
2 * Driver for Dell laptop extras
4 * Copyright (c) Red Hat <mjg@redhat.com>
6 * Based on documentation in the libsmbios package, Copyright (C) 2005 Dell
7 * Inc.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
16 #include <linux/module.h>
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/platform_device.h>
20 #include <linux/backlight.h>
21 #include <linux/err.h>
22 #include <linux/dmi.h>
23 #include <linux/io.h>
24 #include <linux/rfkill.h>
25 #include <linux/power_supply.h>
26 #include <linux/acpi.h>
27 #include <linux/mm.h>
28 #include <linux/i8042.h>
29 #include <linux/slab.h>
30 #include <linux/debugfs.h>
31 #include <linux/seq_file.h>
32 #include "../../firmware/dcdbas.h"
34 #define BRIGHTNESS_TOKEN 0x7d
36 /* This structure will be modified by the firmware when we enter
37 * system management mode, hence the volatiles */
39 struct calling_interface_buffer {
40 u16 class;
41 u16 select;
42 volatile u32 input[4];
43 volatile u32 output[4];
44 } __packed;
46 struct calling_interface_token {
47 u16 tokenID;
48 u16 location;
49 union {
50 u16 value;
51 u16 stringlength;
55 struct calling_interface_structure {
56 struct dmi_header header;
57 u16 cmdIOAddress;
58 u8 cmdIOCode;
59 u32 supportedCmds;
60 struct calling_interface_token tokens[];
61 } __packed;
63 struct quirk_entry {
64 u8 touchpad_led;
67 static struct quirk_entry *quirks;
69 static struct quirk_entry quirk_dell_vostro_v130 = {
70 .touchpad_led = 1,
73 static int dmi_matched(const struct dmi_system_id *dmi)
75 quirks = dmi->driver_data;
76 return 1;
79 static int da_command_address;
80 static int da_command_code;
81 static int da_num_tokens;
82 static struct calling_interface_token *da_tokens;
84 static struct platform_driver platform_driver = {
85 .driver = {
86 .name = "dell-laptop",
87 .owner = THIS_MODULE,
91 static struct platform_device *platform_device;
92 static struct backlight_device *dell_backlight_device;
93 static struct rfkill *wifi_rfkill;
94 static struct rfkill *bluetooth_rfkill;
95 static struct rfkill *wwan_rfkill;
97 static const struct dmi_system_id __initdata dell_device_table[] = {
99 .ident = "Dell laptop",
100 .matches = {
101 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
102 DMI_MATCH(DMI_CHASSIS_TYPE, "8"),
106 .matches = {
107 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
108 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /*Laptop*/
112 .ident = "Dell Computer Corporation",
113 .matches = {
114 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
115 DMI_MATCH(DMI_CHASSIS_TYPE, "8"),
121 static struct dmi_system_id __devinitdata dell_blacklist[] = {
122 /* Supported by compal-laptop */
124 .ident = "Dell Mini 9",
125 .matches = {
126 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
127 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 910"),
131 .ident = "Dell Mini 10",
132 .matches = {
133 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
134 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1010"),
138 .ident = "Dell Mini 10v",
139 .matches = {
140 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
141 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1011"),
145 .ident = "Dell Mini 1012",
146 .matches = {
147 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
148 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
152 .ident = "Dell Inspiron 11z",
153 .matches = {
154 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
155 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1110"),
159 .ident = "Dell Mini 12",
160 .matches = {
161 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
162 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1210"),
168 static struct dmi_system_id __devinitdata dell_quirks[] = {
170 .callback = dmi_matched,
171 .ident = "Dell Vostro V130",
172 .matches = {
173 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
174 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V130"),
176 .driver_data = &quirk_dell_vostro_v130,
179 .callback = dmi_matched,
180 .ident = "Dell Vostro V131",
181 .matches = {
182 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
183 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"),
185 .driver_data = &quirk_dell_vostro_v130,
188 .callback = dmi_matched,
189 .ident = "Dell Vostro 3555",
190 .matches = {
191 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
192 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3555"),
194 .driver_data = &quirk_dell_vostro_v130,
197 .callback = dmi_matched,
198 .ident = "Dell Inspiron N311z",
199 .matches = {
200 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
201 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron N311z"),
203 .driver_data = &quirk_dell_vostro_v130,
206 .callback = dmi_matched,
207 .ident = "Dell Inspiron M5110",
208 .matches = {
209 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
210 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron M5110"),
212 .driver_data = &quirk_dell_vostro_v130,
217 static struct calling_interface_buffer *buffer;
218 static struct page *bufferpage;
219 static DEFINE_MUTEX(buffer_mutex);
221 static int hwswitch_state;
223 static void get_buffer(void)
225 mutex_lock(&buffer_mutex);
226 memset(buffer, 0, sizeof(struct calling_interface_buffer));
229 static void release_buffer(void)
231 mutex_unlock(&buffer_mutex);
234 static void __init parse_da_table(const struct dmi_header *dm)
236 /* Final token is a terminator, so we don't want to copy it */
237 int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1;
238 struct calling_interface_structure *table =
239 container_of(dm, struct calling_interface_structure, header);
241 /* 4 bytes of table header, plus 7 bytes of Dell header, plus at least
242 6 bytes of entry */
244 if (dm->length < 17)
245 return;
247 da_command_address = table->cmdIOAddress;
248 da_command_code = table->cmdIOCode;
250 da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) *
251 sizeof(struct calling_interface_token),
252 GFP_KERNEL);
254 if (!da_tokens)
255 return;
257 memcpy(da_tokens+da_num_tokens, table->tokens,
258 sizeof(struct calling_interface_token) * tokens);
260 da_num_tokens += tokens;
263 static void __init find_tokens(const struct dmi_header *dm, void *dummy)
265 switch (dm->type) {
266 case 0xd4: /* Indexed IO */
267 break;
268 case 0xd5: /* Protected Area Type 1 */
269 break;
270 case 0xd6: /* Protected Area Type 2 */
271 break;
272 case 0xda: /* Calling interface */
273 parse_da_table(dm);
274 break;
278 static int find_token_location(int tokenid)
280 int i;
281 for (i = 0; i < da_num_tokens; i++) {
282 if (da_tokens[i].tokenID == tokenid)
283 return da_tokens[i].location;
286 return -1;
289 static struct calling_interface_buffer *
290 dell_send_request(struct calling_interface_buffer *buffer, int class,
291 int select)
293 struct smi_cmd command;
295 command.magic = SMI_CMD_MAGIC;
296 command.command_address = da_command_address;
297 command.command_code = da_command_code;
298 command.ebx = virt_to_phys(buffer);
299 command.ecx = 0x42534931;
301 buffer->class = class;
302 buffer->select = select;
304 dcdbas_smi_request(&command);
306 return buffer;
309 /* Derived from information in DellWirelessCtl.cpp:
310 Class 17, select 11 is radio control. It returns an array of 32-bit values.
312 Input byte 0 = 0: Wireless information
314 result[0]: return code
315 result[1]:
316 Bit 0: Hardware switch supported
317 Bit 1: Wifi locator supported
318 Bit 2: Wifi is supported
319 Bit 3: Bluetooth is supported
320 Bit 4: WWAN is supported
321 Bit 5: Wireless keyboard supported
322 Bits 6-7: Reserved
323 Bit 8: Wifi is installed
324 Bit 9: Bluetooth is installed
325 Bit 10: WWAN is installed
326 Bits 11-15: Reserved
327 Bit 16: Hardware switch is on
328 Bit 17: Wifi is blocked
329 Bit 18: Bluetooth is blocked
330 Bit 19: WWAN is blocked
331 Bits 20-31: Reserved
332 result[2]: NVRAM size in bytes
333 result[3]: NVRAM format version number
335 Input byte 0 = 2: Wireless switch configuration
336 result[0]: return code
337 result[1]:
338 Bit 0: Wifi controlled by switch
339 Bit 1: Bluetooth controlled by switch
340 Bit 2: WWAN controlled by switch
341 Bits 3-6: Reserved
342 Bit 7: Wireless switch config locked
343 Bit 8: Wifi locator enabled
344 Bits 9-14: Reserved
345 Bit 15: Wifi locator setting locked
346 Bits 16-31: Reserved
349 static int dell_rfkill_set(void *data, bool blocked)
351 int disable = blocked ? 1 : 0;
352 unsigned long radio = (unsigned long)data;
353 int hwswitch_bit = (unsigned long)data - 1;
354 int ret = 0;
356 get_buffer();
357 dell_send_request(buffer, 17, 11);
359 /* If the hardware switch controls this radio, and the hardware
360 switch is disabled, don't allow changing the software state */
361 if ((hwswitch_state & BIT(hwswitch_bit)) &&
362 !(buffer->output[1] & BIT(16))) {
363 ret = -EINVAL;
364 goto out;
367 buffer->input[0] = (1 | (radio<<8) | (disable << 16));
368 dell_send_request(buffer, 17, 11);
370 out:
371 release_buffer();
372 return ret;
375 static void dell_rfkill_query(struct rfkill *rfkill, void *data)
377 int status;
378 int bit = (unsigned long)data + 16;
379 int hwswitch_bit = (unsigned long)data - 1;
381 get_buffer();
382 dell_send_request(buffer, 17, 11);
383 status = buffer->output[1];
384 release_buffer();
386 rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
388 if (hwswitch_state & (BIT(hwswitch_bit)))
389 rfkill_set_hw_state(rfkill, !(status & BIT(16)));
392 static const struct rfkill_ops dell_rfkill_ops = {
393 .set_block = dell_rfkill_set,
394 .query = dell_rfkill_query,
397 static struct dentry *dell_laptop_dir;
399 static int dell_debugfs_show(struct seq_file *s, void *data)
401 int status;
403 get_buffer();
404 dell_send_request(buffer, 17, 11);
405 status = buffer->output[1];
406 release_buffer();
408 seq_printf(s, "status:\t0x%X\n", status);
409 seq_printf(s, "Bit 0 : Hardware switch supported: %lu\n",
410 status & BIT(0));
411 seq_printf(s, "Bit 1 : Wifi locator supported: %lu\n",
412 (status & BIT(1)) >> 1);
413 seq_printf(s, "Bit 2 : Wifi is supported: %lu\n",
414 (status & BIT(2)) >> 2);
415 seq_printf(s, "Bit 3 : Bluetooth is supported: %lu\n",
416 (status & BIT(3)) >> 3);
417 seq_printf(s, "Bit 4 : WWAN is supported: %lu\n",
418 (status & BIT(4)) >> 4);
419 seq_printf(s, "Bit 5 : Wireless keyboard supported: %lu\n",
420 (status & BIT(5)) >> 5);
421 seq_printf(s, "Bit 8 : Wifi is installed: %lu\n",
422 (status & BIT(8)) >> 8);
423 seq_printf(s, "Bit 9 : Bluetooth is installed: %lu\n",
424 (status & BIT(9)) >> 9);
425 seq_printf(s, "Bit 10: WWAN is installed: %lu\n",
426 (status & BIT(10)) >> 10);
427 seq_printf(s, "Bit 16: Hardware switch is on: %lu\n",
428 (status & BIT(16)) >> 16);
429 seq_printf(s, "Bit 17: Wifi is blocked: %lu\n",
430 (status & BIT(17)) >> 17);
431 seq_printf(s, "Bit 18: Bluetooth is blocked: %lu\n",
432 (status & BIT(18)) >> 18);
433 seq_printf(s, "Bit 19: WWAN is blocked: %lu\n",
434 (status & BIT(19)) >> 19);
436 seq_printf(s, "\nhwswitch_state:\t0x%X\n", hwswitch_state);
437 seq_printf(s, "Bit 0 : Wifi controlled by switch: %lu\n",
438 hwswitch_state & BIT(0));
439 seq_printf(s, "Bit 1 : Bluetooth controlled by switch: %lu\n",
440 (hwswitch_state & BIT(1)) >> 1);
441 seq_printf(s, "Bit 2 : WWAN controlled by switch: %lu\n",
442 (hwswitch_state & BIT(2)) >> 2);
443 seq_printf(s, "Bit 7 : Wireless switch config locked: %lu\n",
444 (hwswitch_state & BIT(7)) >> 7);
445 seq_printf(s, "Bit 8 : Wifi locator enabled: %lu\n",
446 (hwswitch_state & BIT(8)) >> 8);
447 seq_printf(s, "Bit 15: Wifi locator setting locked: %lu\n",
448 (hwswitch_state & BIT(15)) >> 15);
450 return 0;
453 static int dell_debugfs_open(struct inode *inode, struct file *file)
455 return single_open(file, dell_debugfs_show, inode->i_private);
458 static const struct file_operations dell_debugfs_fops = {
459 .owner = THIS_MODULE,
460 .open = dell_debugfs_open,
461 .read = seq_read,
462 .llseek = seq_lseek,
463 .release = single_release,
466 static void dell_update_rfkill(struct work_struct *ignored)
468 if (wifi_rfkill)
469 dell_rfkill_query(wifi_rfkill, (void *)1);
470 if (bluetooth_rfkill)
471 dell_rfkill_query(bluetooth_rfkill, (void *)2);
472 if (wwan_rfkill)
473 dell_rfkill_query(wwan_rfkill, (void *)3);
475 static DECLARE_DELAYED_WORK(dell_rfkill_work, dell_update_rfkill);
478 static int __init dell_setup_rfkill(void)
480 int status;
481 int ret;
483 if (dmi_check_system(dell_blacklist)) {
484 pr_info("Blacklisted hardware detected - not enabling rfkill\n");
485 return 0;
488 get_buffer();
489 dell_send_request(buffer, 17, 11);
490 status = buffer->output[1];
491 buffer->input[0] = 0x2;
492 dell_send_request(buffer, 17, 11);
493 hwswitch_state = buffer->output[1];
494 release_buffer();
496 if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {
497 wifi_rfkill = rfkill_alloc("dell-wifi", &platform_device->dev,
498 RFKILL_TYPE_WLAN,
499 &dell_rfkill_ops, (void *) 1);
500 if (!wifi_rfkill) {
501 ret = -ENOMEM;
502 goto err_wifi;
504 ret = rfkill_register(wifi_rfkill);
505 if (ret)
506 goto err_wifi;
509 if ((status & (1<<3|1<<9)) == (1<<3|1<<9)) {
510 bluetooth_rfkill = rfkill_alloc("dell-bluetooth",
511 &platform_device->dev,
512 RFKILL_TYPE_BLUETOOTH,
513 &dell_rfkill_ops, (void *) 2);
514 if (!bluetooth_rfkill) {
515 ret = -ENOMEM;
516 goto err_bluetooth;
518 ret = rfkill_register(bluetooth_rfkill);
519 if (ret)
520 goto err_bluetooth;
523 if ((status & (1<<4|1<<10)) == (1<<4|1<<10)) {
524 wwan_rfkill = rfkill_alloc("dell-wwan",
525 &platform_device->dev,
526 RFKILL_TYPE_WWAN,
527 &dell_rfkill_ops, (void *) 3);
528 if (!wwan_rfkill) {
529 ret = -ENOMEM;
530 goto err_wwan;
532 ret = rfkill_register(wwan_rfkill);
533 if (ret)
534 goto err_wwan;
537 return 0;
538 err_wwan:
539 rfkill_destroy(wwan_rfkill);
540 if (bluetooth_rfkill)
541 rfkill_unregister(bluetooth_rfkill);
542 err_bluetooth:
543 rfkill_destroy(bluetooth_rfkill);
544 if (wifi_rfkill)
545 rfkill_unregister(wifi_rfkill);
546 err_wifi:
547 rfkill_destroy(wifi_rfkill);
549 return ret;
552 static void dell_cleanup_rfkill(void)
554 if (wifi_rfkill) {
555 rfkill_unregister(wifi_rfkill);
556 rfkill_destroy(wifi_rfkill);
558 if (bluetooth_rfkill) {
559 rfkill_unregister(bluetooth_rfkill);
560 rfkill_destroy(bluetooth_rfkill);
562 if (wwan_rfkill) {
563 rfkill_unregister(wwan_rfkill);
564 rfkill_destroy(wwan_rfkill);
568 static int dell_send_intensity(struct backlight_device *bd)
570 int ret = 0;
572 get_buffer();
573 buffer->input[0] = find_token_location(BRIGHTNESS_TOKEN);
574 buffer->input[1] = bd->props.brightness;
576 if (buffer->input[0] == -1) {
577 ret = -ENODEV;
578 goto out;
581 if (power_supply_is_system_supplied() > 0)
582 dell_send_request(buffer, 1, 2);
583 else
584 dell_send_request(buffer, 1, 1);
586 out:
587 release_buffer();
588 return 0;
591 static int dell_get_intensity(struct backlight_device *bd)
593 int ret = 0;
595 get_buffer();
596 buffer->input[0] = find_token_location(BRIGHTNESS_TOKEN);
598 if (buffer->input[0] == -1) {
599 ret = -ENODEV;
600 goto out;
603 if (power_supply_is_system_supplied() > 0)
604 dell_send_request(buffer, 0, 2);
605 else
606 dell_send_request(buffer, 0, 1);
608 ret = buffer->output[1];
610 out:
611 release_buffer();
612 return ret;
615 static const struct backlight_ops dell_ops = {
616 .get_brightness = dell_get_intensity,
617 .update_status = dell_send_intensity,
620 static void touchpad_led_on(void)
622 int command = 0x97;
623 char data = 1;
624 i8042_command(&data, command | 1 << 12);
627 static void touchpad_led_off(void)
629 int command = 0x97;
630 char data = 2;
631 i8042_command(&data, command | 1 << 12);
634 static void touchpad_led_set(struct led_classdev *led_cdev,
635 enum led_brightness value)
637 if (value > 0)
638 touchpad_led_on();
639 else
640 touchpad_led_off();
643 static struct led_classdev touchpad_led = {
644 .name = "dell-laptop::touchpad",
645 .brightness_set = touchpad_led_set,
646 .flags = LED_CORE_SUSPENDRESUME,
649 static int __devinit touchpad_led_init(struct device *dev)
651 return led_classdev_register(dev, &touchpad_led);
654 static void touchpad_led_exit(void)
656 led_classdev_unregister(&touchpad_led);
659 static bool dell_laptop_i8042_filter(unsigned char data, unsigned char str,
660 struct serio *port)
662 static bool extended;
664 if (str & 0x20)
665 return false;
667 if (unlikely(data == 0xe0)) {
668 extended = true;
669 return false;
670 } else if (unlikely(extended)) {
671 switch (data) {
672 case 0x8:
673 schedule_delayed_work(&dell_rfkill_work,
674 round_jiffies_relative(HZ));
675 break;
677 extended = false;
680 return false;
683 static int __init dell_init(void)
685 int max_intensity = 0;
686 int ret;
688 if (!dmi_check_system(dell_device_table))
689 return -ENODEV;
691 quirks = NULL;
692 /* find if this machine support other functions */
693 dmi_check_system(dell_quirks);
695 dmi_walk(find_tokens, NULL);
697 if (!da_tokens) {
698 pr_info("Unable to find dmi tokens\n");
699 return -ENODEV;
702 ret = platform_driver_register(&platform_driver);
703 if (ret)
704 goto fail_platform_driver;
705 platform_device = platform_device_alloc("dell-laptop", -1);
706 if (!platform_device) {
707 ret = -ENOMEM;
708 goto fail_platform_device1;
710 ret = platform_device_add(platform_device);
711 if (ret)
712 goto fail_platform_device2;
715 * Allocate buffer below 4GB for SMI data--only 32-bit physical addr
716 * is passed to SMI handler.
718 bufferpage = alloc_page(GFP_KERNEL | GFP_DMA32);
720 if (!bufferpage)
721 goto fail_buffer;
722 buffer = page_address(bufferpage);
724 ret = dell_setup_rfkill();
726 if (ret) {
727 pr_warn("Unable to setup rfkill\n");
728 goto fail_rfkill;
731 ret = i8042_install_filter(dell_laptop_i8042_filter);
732 if (ret) {
733 pr_warn("Unable to install key filter\n");
734 goto fail_filter;
737 if (quirks && quirks->touchpad_led)
738 touchpad_led_init(&platform_device->dev);
740 dell_laptop_dir = debugfs_create_dir("dell_laptop", NULL);
741 if (dell_laptop_dir != NULL)
742 debugfs_create_file("rfkill", 0444, dell_laptop_dir, NULL,
743 &dell_debugfs_fops);
745 #ifdef CONFIG_ACPI
746 /* In the event of an ACPI backlight being available, don't
747 * register the platform controller.
749 if (acpi_video_backlight_support())
750 return 0;
751 #endif
753 get_buffer();
754 buffer->input[0] = find_token_location(BRIGHTNESS_TOKEN);
755 if (buffer->input[0] != -1) {
756 dell_send_request(buffer, 0, 2);
757 max_intensity = buffer->output[3];
759 release_buffer();
761 if (max_intensity) {
762 struct backlight_properties props;
763 memset(&props, 0, sizeof(struct backlight_properties));
764 props.type = BACKLIGHT_PLATFORM;
765 props.max_brightness = max_intensity;
766 dell_backlight_device = backlight_device_register("dell_backlight",
767 &platform_device->dev,
768 NULL,
769 &dell_ops,
770 &props);
772 if (IS_ERR(dell_backlight_device)) {
773 ret = PTR_ERR(dell_backlight_device);
774 dell_backlight_device = NULL;
775 goto fail_backlight;
778 dell_backlight_device->props.brightness =
779 dell_get_intensity(dell_backlight_device);
780 backlight_update_status(dell_backlight_device);
783 return 0;
785 fail_backlight:
786 i8042_remove_filter(dell_laptop_i8042_filter);
787 cancel_delayed_work_sync(&dell_rfkill_work);
788 fail_filter:
789 dell_cleanup_rfkill();
790 fail_rfkill:
791 free_page((unsigned long)bufferpage);
792 fail_buffer:
793 platform_device_del(platform_device);
794 fail_platform_device2:
795 platform_device_put(platform_device);
796 fail_platform_device1:
797 platform_driver_unregister(&platform_driver);
798 fail_platform_driver:
799 kfree(da_tokens);
800 return ret;
803 static void __exit dell_exit(void)
805 debugfs_remove_recursive(dell_laptop_dir);
806 if (quirks && quirks->touchpad_led)
807 touchpad_led_exit();
808 i8042_remove_filter(dell_laptop_i8042_filter);
809 cancel_delayed_work_sync(&dell_rfkill_work);
810 backlight_device_unregister(dell_backlight_device);
811 dell_cleanup_rfkill();
812 if (platform_device) {
813 platform_device_unregister(platform_device);
814 platform_driver_unregister(&platform_driver);
816 kfree(da_tokens);
817 free_page((unsigned long)buffer);
820 module_init(dell_init);
821 module_exit(dell_exit);
823 MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>");
824 MODULE_DESCRIPTION("Dell laptop driver");
825 MODULE_LICENSE("GPL");
826 MODULE_ALIAS("dmi:*svnDellInc.:*:ct8:*");
827 MODULE_ALIAS("dmi:*svnDellInc.:*:ct9:*");
828 MODULE_ALIAS("dmi:*svnDellComputerCorporation.:*:ct8:*");