[PATCH 3.16 178/366] Input: elantech - fix V4 report decoding for module with middle key
From: Ben Hutchings
Date: Sun Nov 11 2018 - 15:37:11 EST
3.16.61-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: ??? <kt.liao@xxxxxxxxxx>
commit e0ae2519ca004a628fa55aeef969c37edce522d3 upstream.
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@xxxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
drivers/input/mouse/elantech.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -737,7 +737,7 @@ static int elantech_packet_check_v4(stru
if (etd->crc_enabled)
sanity_check = ((packet[3] & 0x08) == 0x00);
else
- sanity_check = ((packet[0] & 0x0c) == 0x04 &&
+ sanity_check = ((packet[0] & 0x08) == 0x00 &&
(packet[3] & 0x1c) == 0x10);
if (!sanity_check)