Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1121775ybl; Thu, 22 Aug 2019 09:39:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz90JODcCRsomv+diYgQ5jroHY9yp3f9xGnkjLdN28kf68nJe8Bgh9/SSezjOz6NHyn1cRx X-Received: by 2002:a17:902:6b06:: with SMTP id o6mr39825442plk.33.1566491951090; Thu, 22 Aug 2019 09:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566491951; cv=none; d=google.com; s=arc-20160816; b=zpO4Ac2FG3K9EMSfKUnJXPGaqQLaaI1YCncV2++QpwmrJ3thY4JGBgsZlJ/8UiAYpg MkAtjTEUu/jkI4hjiy+RxKMyXMNK5ALFc3gMcUCIrG5ZVhmwtJ5cIz+Rx9HA+Mwqqk59 yz5gIKLO7jBOHwVIV5irPWRdRHHcXRE2Oa8AQo2ZrHsVUyyNXznMlK7t/bzcxtzoxn2x bwBBCi/4+aMpBCU5ZpJ11NLDQH9r65GEeQ2smCYGKJ7RFzkgXyw9oaG9FlJK3rLnTuX6 zQKo+TPe/Obtn/YbOcquq3YV7Jf6HbCYpJPpQHAfhSYVFjHBSSmc3C2IfRv7/KC4138K BJxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=WlyWNX/Sx1aGVokgx+XlHnmHHvZzb+FekN1Y/C+OiPM=; b=Rq2FSDqtetSNrVUQqF7RwqVMsnuAkenkqQVrdk1njRrbCEVPTxdQtC2YhQo10LI2Jv VIX1CnlhdjgqMBm8sHyJyg0Vv76rllzbzAyi84LbolbooXw3A1vShZNL2PmocWw/aTmW asVJ//R1UyRHsUrnXwr5dkmc2MT0XCJ+X4P+QrKRZOkfI6m5CAkAW4eH/vcYr1+ihWc9 aOy08jdJwcSsi+RwciIFCOIDB+M1yWi4w2ItwwdTJPUhSPNHW0o9psipoyLlmwhk985D fzGbmIkarncAQN6+1My4+PVcxBHk/7BHtO7bSmApuERbGtf7PTn+PRPDIYQlRraO7uWh 62ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=kOumEtyM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si17083189pgk.107.2019.08.22.09.38.55; Thu, 22 Aug 2019 09:39:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=kOumEtyM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388263AbfHVMIV (ORCPT + 99 others); Thu, 22 Aug 2019 08:08:21 -0400 Received: from mout01.posteo.de ([185.67.36.65]:50721 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731326AbfHVMIV (ORCPT ); Thu, 22 Aug 2019 08:08:21 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 17F5E160060 for ; Thu, 22 Aug 2019 14:08:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1566475698; bh=Sg1Anz4zYb3hs4rsAoh/K0xqi2SEWfUCRmkWAkmoWZ0=; h=Date:From:To:Cc:Subject:From; b=kOumEtyMQj/qTbFn8/Q1Wx/CnIekoYFiqpZEeLvU0SVwVIZKY+3NxUfaCYNIpXTXD sI+O6i8ztyTA1kuw4TShJbssnTUJ5Pti17/zFgAXep3rAwQdFKa41pUqo7CTITkN9q Q/DfKPhlP2lyohiq41WRnDnDIC7pTlTZT5arn8RnfoyNx4XyEABuZmdqdHm2AMPdqF KjEgiRgVLTtmpj90y/krooDNLsbEJAd6CKZgxPRo48FXRCDQbfq8gKAJFCOcEezsSL wKZHydtX0yCnF3XFv/mKYipjdFxMfvAUIg2Q89npET4wdRyUTzS7e7y9Ijg/8cGc5Q qmAakkuC2ecXQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46Djwc07lbz6tmG; Thu, 22 Aug 2019 14:08:16 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 22 Aug 2019 14:08:14 +0200 From: Martin Kepplinger To: Dixit Parmar Cc: dmitry.torokhov@gmail.com, rydberg@bitmath.org, kuninori.morimoto.gx@renesas.com, robh@kernel.org, matthias.fend@wolfvision.net, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] driver:st1633: fixed multitouch incorrect coordinates In-Reply-To: <1566209314-21767-1-git-send-email-dixitparmar19@gmail.com> References: <1566209314-21767-1-git-send-email-dixitparmar19@gmail.com> Message-ID: <8cfedf751fc87f5f1c660cfda69d36ce@posteo.de> X-Sender: martink@posteo.de User-Agent: Posteo Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 19.08.2019 12:08 schrieb Dixit Parmar: > From: Dixit Parmar > > For Sitronix st1633 multi-touch controller driver the co-ordinates > reported > for multiple fingers were wrong. > > So the below mentioned bug was filed, > Bugzilla Bug ID: 204561 > > While reading co-ordinates from specified I2C registers, the X & Y > co-ordinates should be read from proper I2C address for particular > finger as > specified in chip specific datasheet. > > for single touch this logic is working fine. However, for multi-touch > scenario the logic of reading data from data buffer has issues. > > This patch fixes the reading logic from data buffer. > > Previous logic: > * Offset of X & Y Lower byte coordinate is increased by i no. only(by 1 > Byte) > for each finger. > > New logic: > * The logic of reading X & Y Lower Byte coordinate needs to be > increased > by i+y for each time/finger. > > Signed-off-by: Dixit Parmar > --- > drivers/input/touchscreen/st1232.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/touchscreen/st1232.c > b/drivers/input/touchscreen/st1232.c > index 3492339..1139714 100644 > --- a/drivers/input/touchscreen/st1232.c > +++ b/drivers/input/touchscreen/st1232.c > @@ -81,8 +81,10 @@ static int st1232_ts_read_data(struct st1232_ts_data > *ts) > for (i = 0, y = 0; i < ts->chip_info->max_fingers; i++, y += 3) { > finger[i].is_valid = buf[i + y] >> 7; > if (finger[i].is_valid) { > - finger[i].x = ((buf[i + y] & 0x0070) << 4) | buf[i + 1]; > - finger[i].y = ((buf[i + y] & 0x0007) << 8) | buf[i + 2]; > + finger[i].x = ((buf[i + y] & 0x0070) << 4) | > + buf[i + y + 1]; > + finger[i].y = ((buf[i + y] & 0x0007) << 8) | > + buf[i + y + 2]; Seems like you're right. It's simply +1 (for x) and +2 (for y) from the high-byte locations. Not sure how that went wrong. Thank you, Reviewed-by: Martin Kepplinger > > /* st1232 includes a z-axis / touch strength */ > if (ts->chip_info->have_z)