Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2248139imm; Mon, 28 May 2018 04:44:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZox/5ULpGzOhoCBHURUuXC43KThzB825uqRAUZubiSJDK4PRcog/5ycl1HHkP1FWJ1TfC2S X-Received: by 2002:a63:934d:: with SMTP id w13-v6mr10562032pgm.212.1527507857608; Mon, 28 May 2018 04:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527507857; cv=none; d=google.com; s=arc-20160816; b=JqjJIa43d7M8svEVZquOyDX3ejMi9QQXIMAIoaob22UJMb5LkKw16SR24KkqpSiMPp 7TJeOTvTzhHNMFkAfTCA7NXG4mFfqukRWhcezBXDDtKBxtn3eZFW+E2P/UCJajyLh6In TkfcgTPlSCJ7yCfXquiiRfLEIZFlIVOmslXeuWBni744SW2viv/09NJ5lL8mObHZvaqi eLYNBRKM7uUx9FypgXuSwTYvBcF9PxDt1M3KD8Ecc51KJtiRmeArAFyR2lFbTa2FsQ0L W/nr/I0E8tkmxtm5nCHznFYdhYjvgiPSXkeRbZusk423d0cTSFcs4ogPc/Ekqukl1p/S IdJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MT+np6ZWUXOsXPXNYe7H9w/mpklKBsSax0z2Mx7No/g=; b=tnM2pJ1JtTilBQd635b9YfUUS8kRyfrrZCx8zDR+O7k2oGdJBLN36pEYkBgOFRQXMV uX2fXpVEHmBFNDY+dmm5kGqAdiXWEo27T+4w8Z1H0tx5or0KTfajb31+eNhOnpxgFnYg aBcJM4NUGVQLIFTePKYg0Q4PMdg14MIntiydVLfZbvKTIKjQPfXKv+b3G6IsfNn8WRfB a0xT0DcIsaju7ga61xt/dk/Kc9qgmQa+2NoGHzBUE0dXHl6rUu5w1yRq0iG58YQDrO4E URo1vqwnPVxAvCIv4GK7Os04tO79ktNesfVbbP+4NlPU+vZEh1Biz67QwgEoNWzf6mT9 KeHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b67-v6si30006557pfa.71.2018.05.28.04.44.02; Mon, 28 May 2018 04:44:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938394AbeE1LnP (ORCPT + 99 others); Mon, 28 May 2018 07:43:15 -0400 Received: from emcscan.emc.com.tw ([192.72.220.5]:43896 "EHLO emcscan.emc.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932573AbeE1LnB (ORCPT ); Mon, 28 May 2018 07:43:01 -0400 X-Greylist: delayed 591 seconds by postgrey-1.27 at vger.kernel.org; Mon, 28 May 2018 07:43:01 EDT Received: from unknown (HELO webmail.emc.com.tw) ([192.168.10.1]) by emcscan.emc.com.tw with SMTP; 28 May 2018 19:33:08 +0800 Received: from 192.168.10.23 by webmail.emc.com.tw with MailAudit ESMTP Server V5.0(124517:0:AUTH_RELAY) (envelope-from ); Mon, 28 May 2018 19:33:06 +0800 (CST) Received: from 192.168.33.46 by webmail.emc.com.tw with Mail2000 ESMTPA Server V7.00(124024:0:AUTH_LOGIN) (envelope-from ); Mon, 28 May 2018 19:33:06 +0800 (CST) From: KT Liao To: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, ulrik.debie-os@e2big.org Cc: phoenix@emc.com.tw, kt.liao@emc.com.tw, aaron.ma@canonical.com, josh.chen@emc.com.tw Subject: [PATCH] Input: elantech - Fix V4 report decoding for module with middle key Date: Mon, 28 May 2018 19:33:02 +0800 Message-Id: <1527507182-3858-1-git-send-email-kt.liao@emc.com.tw> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/input/mouse/elantech.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index fb4d902..f39dc66 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -799,7 +799,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) else if (ic_version == 7 && etd->info.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) -- 2.7.4