]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
platform/x86: thinkpad_acpi: suppress warning about palm detection
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 12 Jan 2018 11:04:45 +0000 (12:04 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 17:44:25 +0000 (13:44 -0400)
BugLink: http://bugs.launchpad.net/bugs/1774063
[ Upstream commit 587d8628fb71c3bfae29fb2bbe84c1478c59bac8 ]

This patch prevents the thinkpad_acpi driver from warning about 2 event
codes returned for keyboard palm-detection. No behavioral changes,
other than suppressing the warning in the kernel log. The events are
still forwarded via acpi-netlink channels.

We could, optionally, decide to forward the event through a
input-switch on the tpacpi input device. However, so far no suitable
input-code exists, and no similar drivers report such events. Hence,
leave it an acpi event for now.

Note that the event-codes are named based on empirical studies. On the
ThinkPad X1 5th Gen the sensor can be found underneath the arrow key.

Cc: Matthew Thode <mthode@mthode.org>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/platform/x86/thinkpad_acpi.c

index 117be48ff4de9a3a70df898565cf6495e92d7ddd..128f91af716e8b94a7d4835d3ee68348f1e3f195 100644 (file)
@@ -214,6 +214,10 @@ enum tpacpi_hkey_event_t {
        /* AC-related events */
        TP_HKEY_EV_AC_CHANGED           = 0x6040, /* AC status changed */
 
+       /* Further user-interface events */
+       TP_HKEY_EV_PALM_DETECTED        = 0x60b0, /* palm hoveres keyboard */
+       TP_HKEY_EV_PALM_UNDETECTED      = 0x60b1, /* palm removed */
+
        /* Misc */
        TP_HKEY_EV_RFKILL_CHANGED       = 0x7000, /* rfkill switch changed */
 };
@@ -4079,6 +4083,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,
                *send_acpi_ev = false;
                break;
 
+       case TP_HKEY_EV_PALM_DETECTED:
+       case TP_HKEY_EV_PALM_UNDETECTED:
+               /* palm detected hovering the keyboard, forward to user-space
+                * via netlink for consumption */
+               return true;
+
        default:
                pr_warn("unknown possible thermal alarm or keyboard event received\n");
                known = false;