From patchwork Mon Jun 21 21:06:28 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: 107256 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 o5LL80UL017344 for ; Mon, 21 Jun 2010 21:08:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758573Ab0FUVIH (ORCPT ); Mon, 21 Jun 2010 17:08:07 -0400 Received: from mailservice.tudelft.nl ([130.161.131.5]:44459 "EHLO mailservice.tudelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758439Ab0FUVIG (ORCPT ); Mon, 21 Jun 2010 17:08:06 -0400 Received: from localhost (localhost [127.0.0.1]) by amavis (Postfix) with ESMTP id A5B0F2B810D; Mon, 21 Jun 2010 23:08:05 +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.73]) by localhost (tudelft.nl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id I1PW7V6S1Nfx; Mon, 21 Jun 2010 23:08:04 +0200 (CEST) Received: from smtp-a.tudelft.nl (smtp-a.tudelft.nl [130.161.180.7]) by mx2.tudelft.nl (Postfix) with ESMTP id D86502B8095; Mon, 21 Jun 2010 23:08:04 +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 B60F2B3A62; Mon, 21 Jun 2010 23:08:04 +0200 (CEST) Message-ID: <4C1FD454.4050807@tudelft.nl> Date: Mon, 21 Jun 2010 23:06:28 +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 7/7] elantech: average the two coordinates when 2 fingers 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:08 +0000 (UTC) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index c84f741..d1b505a 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -301,11 +301,11 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse) /* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */ y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]); /* - * For compatibility with the X Synaptics driver scale up - * one coordinate and report as ordinary mouse movent + * For compatibility with non-multitouch userspace apps + * report the average of both coordinates and scale up. */ - input_report_abs(dev, ABS_X, x1 << 2); - input_report_abs(dev, ABS_Y, y1 << 2); + input_report_abs(dev, ABS_X, (x1 + x2) << 1); + input_report_abs(dev, ABS_Y, (y1 + y2) << 1); /* * For compatibility with the proprietary X Elantech driver * report both coordinates as hat coordinates