diff options
Diffstat (limited to 'drivers/platform/x86/dell-wmi.c')
-rw-r--r-- | drivers/platform/x86/dell-wmi.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 75e637047d36..8a64c7967753 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c @@ -329,6 +329,10 @@ static void dell_wmi_process_key(int type, int code) if (type == 0x0000 && code == 0xe025 && !wmi_requires_smbios_request) return; + if (key->keycode == KEY_KBDILLUMTOGGLE) + dell_laptop_call_notifier( + DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED, NULL); + sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true); } @@ -603,23 +607,15 @@ static int __init dell_wmi_input_setup(void) err = input_register_device(dell_wmi_input_dev); if (err) - goto err_free_keymap; + goto err_free_dev; return 0; - err_free_keymap: - sparse_keymap_free(dell_wmi_input_dev); err_free_dev: input_free_device(dell_wmi_input_dev); return err; } -static void dell_wmi_input_destroy(void) -{ - sparse_keymap_free(dell_wmi_input_dev); - input_unregister_device(dell_wmi_input_dev); -} - /* * Descriptor buffer is 128 byte long and contains: * @@ -740,7 +736,7 @@ static int __init dell_wmi_init(void) status = wmi_install_notify_handler(DELL_EVENT_GUID, dell_wmi_notify, NULL); if (ACPI_FAILURE(status)) { - dell_wmi_input_destroy(); + input_unregister_device(dell_wmi_input_dev); pr_err("Unable to register notify handler - %d\n", status); return -ENODEV; } @@ -752,7 +748,7 @@ static int __init dell_wmi_init(void) if (err) { pr_err("Failed to enable WMI events\n"); wmi_remove_notify_handler(DELL_EVENT_GUID); - dell_wmi_input_destroy(); + input_unregister_device(dell_wmi_input_dev); return err; } } @@ -766,6 +762,6 @@ static void __exit dell_wmi_exit(void) if (wmi_requires_smbios_request) dell_wmi_events_set_enabled(false); wmi_remove_notify_handler(DELL_EVENT_GUID); - dell_wmi_input_destroy(); + input_unregister_device(dell_wmi_input_dev); } module_exit(dell_wmi_exit); |