From patchwork Mon Jun 21 21:02:34 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: 107251 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LL80UG017344 for ; Mon, 21 Jun 2010 21:08:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758508Ab0FUVID (ORCPT ); Mon, 21 Jun 2010 17:08:03 -0400 Received: from mailservice.tudelft.nl ([130.161.131.5]:49563 "EHLO mailservice.tudelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758347Ab0FUVIB (ORCPT ); Mon, 21 Jun 2010 17:08:01 -0400 Received: from localhost (localhost [127.0.0.1]) by amavis (Postfix) with ESMTP id B26017F800E; Mon, 21 Jun 2010 23:08:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at tudelft.nl X-Spam-Flag: NO X-Spam-Score: -22.589 X-Spam-Level: X-Spam-Status: No, score=-22.589 tagged_above=-99 required=5 tests=[BAYES_00=-2.599, PROLO_LEO3=0.01, TUD_REL01=-20] autolearn=ham Received: from mailservice.tudelft.nl ([130.161.131.69]) by localhost (tudelft.nl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IDixbnHBCnIW; Mon, 21 Jun 2010 23:07:59 +0200 (CEST) Received: from smtp-a.tudelft.nl (smtp-a.tudelft.nl [130.161.180.7]) by mx1.tudelft.nl (Postfix) with ESMTP id EB2CD7F8034; Mon, 21 Jun 2010 23:07:59 +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 C82BDB3A62; Mon, 21 Jun 2010 23:07:59 +0200 (CEST) Message-ID: <4C1FD36A.8000500@tudelft.nl> Date: Mon, 21 Jun 2010 23:02:34 +0200 From: =?UTF-8?B?w4lyaWMgUGllbA==?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100614 Mandriva/3.0.4-11mdv2010.1 (2010.1) Thunderbird/3.0.4 MIME-Version: 1.0 To: Dmitry Torokhov , "linux-input@vger.kernel.org" CC: Florian Ragwitz Subject: [PATCH 2/7] [NEEDS TEST] elantech: discard the first 2 positions reports for some firmwares References: <4C1FD2B0.1080504@tudelft.nl> In-Reply-To: <4C1FD2B0.1080504@tudelft.nl> 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]); Mon, 21 Jun 2010 21:08:04 +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; }