From patchwork Sun Mar 27 07:48:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiu Zeng X-Patchwork-Id: 8675611 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB2B7C0553 for ; Sun, 27 Mar 2016 07:48:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDD6720259 for ; Sun, 27 Mar 2016 07:48:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01BB62022D for ; Sun, 27 Mar 2016 07:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898AbcC0Hsv (ORCPT ); Sun, 27 Mar 2016 03:48:51 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36442 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbcC0Hsu (ORCPT ); Sun, 27 Mar 2016 03:48:50 -0400 Received: by mail-pf0-f193.google.com with SMTP id q129so16866895pfb.3; Sun, 27 Mar 2016 00:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:to:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=A4RjWa1b6ZK64BLlpJ71AwJGWHH+HIBghGym6vhn3Hg=; b=I11T11z/Ohij71rM0ucX0UBq/DRU78TyrFGng+Y0D4bswAgaT0823eVVmweqygOSsX h1v0SnhAqkh09k4rmlxHgQQhxONvCzWDMwpRUjgsXA5ZsES2+Ufg8BSVRzjTx1JmbZgi OHloNUNxrH/xrhE283u5VdwMsD2ax5+f0+KDzW30PoYtdiTaoHx0P5h39AFlPIu7oPVR +nVmYqLXlydj/9paxL1RYp45nprIrYefH1E4u8Y5GHMsQUJSU2VjMG+UWdpxMPHBb+bF jiE2O3cL6yFAndrccBXoNwQJz74xFmXqFr5nFpdPWl6Ga9yt8nvuDj8rPfYrfDe+v2Yv RepQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=A4RjWa1b6ZK64BLlpJ71AwJGWHH+HIBghGym6vhn3Hg=; b=BzUgOa2higNiAmjqDFzQ7hZaoUr/OH+gqgY9Qmnoaj+1ANJB2246ky9KYERYgaM8z5 kBB2p7tEKskR4fpMBSQOtsz0eWp2x2QPIMjH+OtLOvSfZRnrSG49QFuETFE8vKIZHo1T tRVbaLg2ShaTPLNuhgto4pKzrAuemc/XxFsPBvUsReFsSRcCd+oK1gVDTMgXONVgakk5 m0TEzR0nwx2WnXOrZGAfPivTGsAuCWMmx3IxW0FaATlZailANEMsZCVf5lYA1/1jQe/2 SfPFJb/Wbrx83vcEm982Ur50YojUcilsWo7ua9ZPGBHXPT2JiQghBoy/xt3cq8Lq7pPd V/Rw== X-Gm-Message-State: AD7BkJJ4ThUgZlPPrMFUUuT9v3tAMztvVyPeP203DnhBwp+Yi9uGZbuOufTujAS3JV6Rug== X-Received: by 10.98.69.193 with SMTP id n62mr33057343pfi.46.1459064930039; Sun, 27 Mar 2016 00:48:50 -0700 (PDT) Received: from [0.0.0.0] (tor-exit.gansta93.com. [195.154.56.44]) by smtp.googlemail.com with ESMTPSA id fk10sm27199147pab.33.2016.03.27.00.48.22 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2016 00:48:49 -0700 (PDT) Subject: [PATCH 30/31] input: mouse: use parity8 in elantech References: <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com> To: Dmitry Torokhov , Benjamin Tissoires , Ulrik De Bie , Hans de Goede , =?UTF-8?B?5rSq5LiA56u5?= , Peter Hutterer , Duson Lin , Takashi Iwai Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org From: "zhaoxiu.zeng" Message-ID: <56F79038.3030405@gmail.com> Date: Sun, 27 Mar 2016 15:48:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- drivers/input/mouse/elantech.c | 10 +++------- drivers/input/mouse/elantech.h | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 78f93cf..778b5d1 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -693,9 +693,9 @@ static int elantech_packet_check_v1(struct psmouse *psmouse) p3 = (packet[0] & 0x04) >> 2; - return etd->parity[packet[1]] == p1 && - etd->parity[packet[2]] == p2 && - etd->parity[packet[3]] == p3; + return parity8(packet[1]) != p1 && + parity8(packet[2]) != p2 && + parity8(packet[3]) != p3; } static int elantech_debounce_check_v2(struct psmouse *psmouse) @@ -1635,10 +1635,6 @@ int elantech_init(struct psmouse *psmouse) psmouse_reset(psmouse); - etd->parity[0] = 1; - for (i = 1; i < 256; i++) - etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; - /* * Do the version query again so we can store the result */ diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h index e1cbf40..542c5d9 100644 --- a/drivers/input/mouse/elantech.h +++ b/drivers/input/mouse/elantech.h @@ -141,7 +141,6 @@ struct elantech_data { unsigned int y_max; unsigned int width; struct finger_pos mt[ETP_MAX_FINGERS]; - unsigned char parity[256]; int (*send_cmd)(struct psmouse *psmouse, unsigned char c, unsigned char *param); void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate); };