From patchwork Sun Aug 8 22:55:45 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: 118310 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 o78Mtqwq026043 for ; Sun, 8 Aug 2010 22:55:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754784Ab0HHWzz (ORCPT ); Sun, 8 Aug 2010 18:55:55 -0400 Received: from mailservice.tudelft.nl ([130.161.131.5]:58378 "EHLO mailservice.tudelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754712Ab0HHWzy (ORCPT ); Sun, 8 Aug 2010 18:55:54 -0400 Received: from localhost (localhost [127.0.0.1]) by amavis (Postfix) with ESMTP id 8E96B7F8022; Mon, 9 Aug 2010 00:55:53 +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 0ZcuD9VKBDn1; Mon, 9 Aug 2010 00:55:52 +0200 (CEST) Received: from smtp-a.tudelft.nl (smtp-a.tudelft.nl [130.161.180.7]) by mx1.tudelft.nl (Postfix) with ESMTP id B69BE7F8021; Mon, 9 Aug 2010 00:55:52 +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 0FB36B3A62; Mon, 9 Aug 2010 00:55:51 +0200 (CEST) Message-ID: <4C5F35F1.5070104@tudelft.nl> Date: Mon, 09 Aug 2010 00:55:45 +0200 From: =?ISO-8859-1?Q?=C9ric_Piel?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100808 Mandriva/3.1.2-2mdv2011.0 (2011.0) Thunderbird/3.1.2 MIME-Version: 1.0 To: Dmitry Torokhov CC: Henrik Rydberg , Chris Bagwell , "linux-input@vger.kernel.org" , Florian Ragwitz Subject: [PATCH 10/10] elantech: don't take into account the border size in the calculations References: <4C567F27.7070900@tudelft.nl> <4C5697C4.1020801@euromail.se> <4C56A81E.3040703@tudelft.nl> <4C56AA67.8000902@euromail.se> <4C56AD12.1080106@tudelft.nl> <4C56B00B.50204@euromail.se> <4C56B686.60606@tudelft.nl> <4C56BA13.3030104@euromail.se> <4C56BE30.2070807@tudelft.nl> <4C56C213.2010605@euromail.se> <20100802163913.GB3276@core.coreip.homeip.net> <4C5F34F4.7030503@tudelft.nl> In-Reply-To: <4C5F34F4.7030503@tudelft.nl> X-Enigmail-Version: 1.1.2 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, 08 Aug 2010 22:55:56 +0000 (UTC) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index ba1c3d8..bf95adf 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -584,22 +584,30 @@ static void elantech_set_input_params(struct psmouse *psmouse) __set_bit(BTN_FORWARD, dev->keybit); __set_bit(BTN_BACK, dev->keybit); } - input_set_abs_params(dev, ABS_X, ETP_XMIN_V1, ETP_XMAX_V1, 0, 0); - input_set_abs_params(dev, ABS_Y, ETP_YMIN_V1, ETP_YMAX_V1, 0, 0); + input_set_abs_params(dev, ABS_X, ETP_XMIN_V1 + ETP_EDGE_FUZZ_V1, + ETP_XMAX_V1 - ETP_EDGE_FUZZ_V1, 0, 0); + input_set_abs_params(dev, ABS_Y, ETP_YMIN_V1 + ETP_EDGE_FUZZ_V1, + ETP_YMAX_V1 - ETP_EDGE_FUZZ_V1, 0, 0); break; case 2: __set_bit(BTN_TOOL_QUADTAP, dev->keybit); - input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0); - input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0); + input_set_abs_params(dev, ABS_X, ETP_XMIN_V2 + ETP_EDGE_FUZZ_V2, + ETP_XMAX_V2 - ETP_EDGE_FUZZ_V2, 0, 0); + input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2 + ETP_EDGE_FUZZ_V2, + ETP_YMAX_V2 - ETP_EDGE_FUZZ_V2, 0, 0); if (etd->reports_pres) { input_set_abs_params(dev, ABS_PRESSURE, ETP_PMIN_V2, ETP_PMAX_V2, 0, 0); input_set_abs_params(dev, ABS_TOOL_WIDTH, ETP_WMIN_V2, ETP_WMAX_V2, 0, 0); } - input_set_abs_params(dev, ABS_MT_POSITION_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0); - input_set_abs_params(dev, ABS_MT_POSITION_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0); + input_set_abs_params(dev, ABS_MT_POSITION_X, + ETP_XMIN_V2 + ETP_EDGE_FUZZ_V2, + ETP_XMAX_V2 - ETP_EDGE_FUZZ_V2, 0, 0); + input_set_abs_params(dev, ABS_MT_POSITION_Y, + ETP_YMIN_V2 + ETP_EDGE_FUZZ_V2, + ETP_YMAX_V2 - ETP_EDGE_FUZZ_V2, 0, 0); break; } } diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h index fa9a6b4..75b0546 100644 --- a/drivers/input/mouse/elantech.h +++ b/drivers/input/mouse/elantech.h @@ -60,10 +60,10 @@ */ #define ETP_EDGE_FUZZ_V1 32 -#define ETP_XMIN_V1 ( 0 + ETP_EDGE_FUZZ_V1) -#define ETP_XMAX_V1 (576 - ETP_EDGE_FUZZ_V1) -#define ETP_YMIN_V1 ( 0 + ETP_EDGE_FUZZ_V1) -#define ETP_YMAX_V1 (384 - ETP_EDGE_FUZZ_V1) +#define ETP_XMIN_V1 0 +#define ETP_XMAX_V1 576 +#define ETP_YMIN_V1 0 +#define ETP_YMAX_V1 384 /* * It seems the resolution for hardware version 2 doubled. @@ -72,10 +72,10 @@ */ #define ETP_EDGE_FUZZ_V2 8 -#define ETP_XMIN_V2 ( 0 + ETP_EDGE_FUZZ_V2) -#define ETP_XMAX_V2 (1152 - ETP_EDGE_FUZZ_V2) -#define ETP_YMIN_V2 ( 0 + ETP_EDGE_FUZZ_V2) -#define ETP_YMAX_V2 ( 768 - ETP_EDGE_FUZZ_V2) +#define ETP_XMIN_V2 0 +#define ETP_XMAX_V2 1152 +#define ETP_YMIN_V2 0 +#define ETP_YMAX_V2 768 #define ETP_PMIN_V2 0 #define ETP_PMAX_V2 255 @@ -86,12 +86,10 @@ * For two finger touches the coordinate of each finger gets reported * separately but with reduced resolution. */ -#define ETP_2FT_FUZZ 4 - -#define ETP_2FT_XMIN ( 0 + ETP_2FT_FUZZ) -#define ETP_2FT_XMAX (288 - ETP_2FT_FUZZ) -#define ETP_2FT_YMIN ( 0 + ETP_2FT_FUZZ) -#define ETP_2FT_YMAX (192 - ETP_2FT_FUZZ) +#define ETP_2FT_XMIN 0 +#define ETP_2FT_XMAX 288 +#define ETP_2FT_YMIN 0 +#define ETP_2FT_YMAX 192 struct elantech_data { unsigned char reg_10;