From patchwork Sun May 30 18:42:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?w4PigLByaWMgUGllbA==?= X-Patchwork-Id: 103143 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4UHbJ4e009319 for ; Sun, 30 May 2010 17:37:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043Ab0E3RhY (ORCPT ); Sun, 30 May 2010 13:37:24 -0400 Received: from mailservice.tudelft.nl ([130.161.131.5]:34885 "EHLO mailservice.tudelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174Ab0E3RhX (ORCPT ); Sun, 30 May 2010 13:37:23 -0400 Received: from localhost (localhost [127.0.0.1]) by amavis (Postfix) with ESMTP id E3EC4108C1CD; Sun, 30 May 2010 19:37:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at tudelft.nl X-Spam-Flag: NO X-Spam-Score: -12.589 X-Spam-Level: X-Spam-Status: No, score=-12.589 tagged_above=-99 required=5 tests=[BAYES_00=-2.599, PROLO_LEO3=0.01, TUD_REL01=-10] autolearn=ham Received: from mailservice.tudelft.nl ([130.161.131.74]) by localhost (tudelft.nl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id up-RBMgVNS5E; Sun, 30 May 2010 19:37:22 +0200 (CEST) Received: from smtp-a.tudelft.nl (smtp-a.tudelft.nl [130.161.180.7]) by mx3.tudelft.nl (Postfix) with ESMTP id 1BD0F108C031; Sun, 30 May 2010 19:37:22 +0200 (CEST) Received: from [172.19.3.21] (63-103-dsl.ipact.nl [84.35.103.63]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-a.tudelft.nl (Postfix) with ESMTP id B78CEB3A62; Sun, 30 May 2010 19:37:21 +0200 (CEST) Message-ID: <4C02B18D.3050003@tudelft.nl> Date: Sun, 30 May 2010 20:42:21 +0200 From: =?UTF-8?B?w4lyaWMgUGllbA==?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090319 Mandriva/2.0.0.21-1mdv2009.1 (2009.1) Thunderbird/2.0.0.21 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: Dmitry Torokhov , Florian Ragwitz CC: "linux-input@vger.kernel.org" Subject: [NEEDS TEST][PATCH] elantech: discard the first 2 positions reports for some firmwares X-Enigmail-Version: 1.0.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 30 May 2010 17:37:29 +0000 (UTC) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b18862b..1c1d065 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -185,7 +185,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) struct elantech_data *etd = psmouse->private; unsigned char *packet = psmouse->packet; int fingers; - static int old_fingers; + static int one_finger_reports; if (etd->fw_version < 0x020000) { /* @@ -203,11 +203,13 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) } if (etd->jumpy_cursor) { - /* Discard packets that are likely to have bogus coordinates */ - if (fingers > old_fingers) { + if ((fingers == 1) && (one_finger_reports < 2)) { + /* Discard first 2 reports of one finger, bogus */ + one_finger_reports++; elantech_debug("discarding packet\n"); - goto discard_packet_v1; - } + return; + } else if (fingers != 1) + one_finger_reports = 0; } input_report_key(dev, BTN_TOUCH, fingers != 0); @@ -238,9 +240,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) } input_sync(dev); - - discard_packet_v1: - old_fingers = fingers; } /* @@ -733,12 +732,12 @@ int elantech_init(struct psmouse *psmouse) etd->capabilities = param[0]; /* - * This firmware seems to suffer from misreporting coordinates when + * This firmware suffers from misreporting coordinates when * a touch action starts causing the mouse cursor or scrolled page * to jump. Enable a workaround. */ - if (etd->fw_version == 0x020022) { - pr_info("firmware version 2.0.34 detected, enabling jumpy cursor workaround\n"); + if ((etd->fw_version == 0x020022) || (etd->fw_version == 0x020600)) { + pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n"); etd->jumpy_cursor = 1; }