From patchwork Tue Aug 26 19:30:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrik De Bie X-Patchwork-Id: 4783741 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E19729F2A9 for ; Tue, 26 Aug 2014 19:31:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2012F20154 for ; Tue, 26 Aug 2014 19:31:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D6132014A for ; Tue, 26 Aug 2014 19:31:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752870AbaHZTbL (ORCPT ); Tue, 26 Aug 2014 15:31:11 -0400 Received: from e2big.org ([198.61.226.133]:46033 "EHLO e2big.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbaHZTbK (ORCPT ); Tue, 26 Aug 2014 15:31:10 -0400 Received: from 78-23-174-213.access.telenet.be ([78.23.174.213] helo=lantern.debie) by e2big.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XMMST-0008IK-2Z; Tue, 26 Aug 2014 21:31:09 +0200 From: Ulrik De Bie To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, Hans de Goede , David Herrmann , ulrik.debie-os@e2big.org Subject: [PATCH 1/1] Input: elantech: Correct the sign of the x/y movement for trackpoint Date: Tue, 26 Aug 2014 21:30:23 +0200 Message-Id: <1409081423-2259-1-git-send-email-ulrik.debie-os@e2big.org> X-Mailer: git-send-email 2.1.0.rc1 In-Reply-To: <20140824221424.GA15090@core.coreip.homeip.net> References: <20140824221424.GA15090@core.coreip.homeip.net> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Hi Dmitry, Thank you for your feedback ! The x/y movement calculation was wrong, probably caused by my wrong documentation at the beginning of the elantech_report_trackpoint function. When applying this patch to your patch, it works. Thanks ! --- Ulrik Input: elantech: Correct the sign of the x/y movement for trackpoint From: Ulrik De Bie The sign bit in the documentation of the trackpoint x/y movement is corrected. The sign bit in the calculation of the x/y movement for trackpoint is corrected. Signed-off-by: Ulrik De Bie --- drivers/input/mouse/elantech.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b4d645a..63533e5 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -408,10 +408,10 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, int packet_type) { /* - * byte 0: 0 0 ~sx ~sy 0 M R L - * byte 1: sx 0 0 0 0 0 0 0 - * byte 2: sy 0 0 0 0 0 0 0 - * byte 3: 0 0 sy sx 0 1 1 0 + * byte 0: 0 0 sx sy 0 M R L + * byte 1:~sx 0 0 0 0 0 0 0 + * byte 2:~sy 0 0 0 0 0 0 0 + * byte 3: 0 0 ~sy ~sx 0 1 1 0 * byte 4: x7 x6 x5 x4 x3 x2 x1 x0 * byte 5: y7 y6 y5 y4 y3 y2 y1 y0 * @@ -443,8 +443,8 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, case 0x16008020U: case 0x26800010U: case 0x36808000U: - x = packet[4] - (int)(packet[1] << 1); - y = (int)(packet[2] << 1) - packet[5]; + x = packet[4] - (int)((packet[1]^0x80) << 1); + y = (int)((packet[2]^0x80) << 1) - packet[5]; input_report_key(tp_dev, BTN_LEFT, packet[0] & 0x01); input_report_key(tp_dev, BTN_RIGHT, packet[0] & 0x02);