]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Input: elantech - fix V4 report decoding for module with middle key
author??? <kt.liao@emc.com.tw>
Tue, 3 Jul 2018 05:18:00 +0000 (07:18 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:30:27 +0000 (12:30 +0200)
BugLink: https://bugs.launchpad.net/bugs/1779802
Some touchpad has middle key and it will be indicated in bit 2 of packet[0].
We need to fix V4 formation's byte mask to prevent error decoding.

Signed-off-by: KT Liao <kt.liao@emc.com.tw>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit e0ae2519ca004a628fa55aeef969c37edce522d3)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Acked-by: Hui Wang <hui.wang@canonical.com>
Acked-By: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/input/mouse/elantech.c

index a4aaa748e987f7e4db918e290d20d356f9eec21b..a4f18d5cc88da33cff9d28078df629b79d1bafb5 100644 (file)
@@ -804,7 +804,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
        else if (ic_version == 7 && etd->samples[1] == 0x2A)
                sanity_check = ((packet[3] & 0x1c) == 0x10);
        else
-               sanity_check = ((packet[0] & 0x0c) == 0x04 &&
+               sanity_check = ((packet[0] & 0x08) == 0x00 &&
                                (packet[3] & 0x1c) == 0x10);
 
        if (!sanity_check)