toshiba_acpi: Avoid registering input device on WMI event laptops
authorAzael Avalos <coproscefalo@gmail.com>
Thu, 23 Jul 2015 00:09:12 +0000 (18:09 -0600)
committerDarren Hart <dvhart@linux.intel.com>
Fri, 24 Jul 2015 21:17:59 +0000 (14:17 -0700)
Commit f11f999e9890 ("toshiba_acpi: Refuse to load on machines with
buggy INFO implementations") denied loading on laptops with a WMI Event
GUID given that such laptops manage the hotkeys via that interface,
however, such laptops have a working Toshiba Configuration Interface
(TCI), and thus, such commit denied several supported features.

This patch avoids registering the input device and ignores all hotkey
events on laptops with such WMI Event GUID, making the supported
features found in those laptops to work.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/toshiba_acpi.c

index 802577f43a23379fb4ff167132173cf6a27fa12e..48b16b323c89046211999c623f47dec84d6fa164 100644 (file)
@@ -2466,6 +2466,11 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
        u32 hci_result;
        int error;
 
+       if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) {
+               pr_info("WMI event detected, hotkeys will not be monitored\n");
+               return 0;
+       }
+
        error = toshiba_acpi_enable_hotkeys(dev);
        if (error)
                return error;
@@ -2813,6 +2818,14 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
 
        switch (event) {
        case 0x80: /* Hotkeys and some system events */
+               /*
+                * Machines with this WMI GUID aren't supported due to bugs in
+                * their AML.
+                *
+                * Return silently to avoid triggering a netlink event.
+                */
+               if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID))
+                       return;
                toshiba_acpi_process_hotkeys(dev);
                break;
        case 0x81: /* Dock events */
@@ -2899,14 +2912,6 @@ static int __init toshiba_acpi_init(void)
 {
        int ret;
 
-       /*
-        * Machines with this WMI guid aren't supported due to bugs in
-        * their AML. This check relies on wmi initializing before
-        * toshiba_acpi to guarantee guids have been identified.
-        */
-       if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID))
-               return -ENODEV;
-
        toshiba_proc_dir = proc_mkdir(PROC_TOSHIBA, acpi_root_dir);
        if (!toshiba_proc_dir) {
                pr_err("Unable to create proc dir " PROC_TOSHIBA "\n");
This page took 0.025623 seconds and 5 git commands to generate.