Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3338946imm; Fri, 20 Jul 2018 14:53:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBlb0UkwdV0frgNAPPGet+dM4gnWSY9hoFx7CwQz9N2xJ5kO3syJVYXbB0bf3mrruaUXqp X-Received: by 2002:a17:902:694a:: with SMTP id k10-v6mr3670199plt.166.1532123587373; Fri, 20 Jul 2018 14:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532123587; cv=none; d=google.com; s=arc-20160816; b=wOhcLIZhlpX3hsJ9AHkzvczTrzIqaPtocuS+GpnXvDK2SbWitb5ZRZCteGOVZ4rYH8 O7IfCJ/sOQvULHRrGR/toWuSGYQbXgYAeOXxbRMeua9CgSQ+cbqWPpSRzokV+kUAmVCq 0xE3eVcsl2ykXX+R6GKk0mR0V7qKmPWelhSqC5ErKzQy9Fzg3HUGtNgRmtVxi/5j3ZLp J0BNvo4eH2VHviAJBDsVRce/bI1l4L0jk8r3oN5ie5EabkrcpJm8CE32yxkelEzpXoSN Q51qjyxhEgz2oA+gPWIKmBJaq/MgyvEXKcOnvii66YIiOdrfxEJ5YNm6asfRYDnjiK/8 AhiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CKj6L63F4LCc/O+jnU87JdKYqRK2oAklktLl8EDPu2E=; b=CnVR46zcu2Kopr2fJGusSVZIPyib9jt3SpIkI33r/KZtVM8eNLMLIWrD1fmL2WHduX xjqdiC0Jt1RVy++u5w2FekRc5j6UazZAzHderAQxE92fPBV8G0JJzPIZZhllTNar6/WO sbY0Syw/fttMZhDnme9JFzCBHnKMTdrZ3JWiMougmRZHndDchxRaRu7bg3pqMs3v0dtz /G1C+v9OlPJAb7KdPSASa9dEQ2rS5EfSE+2j2Cd3wNSDdUheTgeuYyQ0+J6tCIVgjNl5 rDJTpG+u+xPrTYMQ/uLWRXw016uV2u0CkMeerrFVRsq175rVTvAEUaitqaE2a0XBu1O0 iYdA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15-v6si2468976pgw.550.2018.07.20.14.52.50; Fri, 20 Jul 2018 14:53:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728446AbeGTWmD (ORCPT + 99 others); Fri, 20 Jul 2018 18:42:03 -0400 Received: from avasout05.plus.net ([84.93.230.250]:41581 "EHLO avasout05.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728312AbeGTWmD (ORCPT ); Fri, 20 Jul 2018 18:42:03 -0400 Received: from hairyalien ([80.229.148.18]) by smtp with SMTP id gdJVf5Nmf05ijgdJWfGBtH; Fri, 20 Jul 2018 22:51:53 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=QJJGuDDL c=1 sm=1 tr=0 a=o7Djd4SkmPXITDn8qH+ssQ==:117 a=o7Djd4SkmPXITDn8qH+ssQ==:17 a=R9QF1RCXAYgA:10 a=V0UhwjhiAAAA:8 a=cm27Pg_UAAAA:8 a=oTaP97jFD5tAdmTDqxEA:9 a=tiEEu-LGr7uwsMrZ:21 a=GSASkbulp0fwIRpx:21 a=_UVLBGXn8Au_dgoMdIS7:22 a=xmb-EsYY8bH0VWELuYED:22 Received: by hairyalien (sSMTP sendmail emulation); Fri, 20 Jul 2018 22:51:49 +0100 From: Nick Dyer To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Chris Healy , Nikita Yushchenko , Lucas Stach , Nick Dyer Subject: [PATCH v1 01/10] Input: atmel_mxt_ts - only use first T9 instance Date: Fri, 20 Jul 2018 22:51:13 +0100 Message-Id: <20180720215122.23558-1-nick@shmanahar.org> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfGzjmYnaK7QAMwTlAdxXsOESMwsI11F/U5kC5w5tFmgX8FVle++vxCZoLkRG494tpkY6vBJosqyoNafcExBDsyYH5MzwqtYhgds0w82eLcRLyaNeEprz f/LUu3J+7e+N4kNgBntN80FkzYt4rgmA4dc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Dyer The driver only registers one input device, which uses the screen parameters from the first T9 instance. The first T63 instance also uses those parameters. It is incorrect to send input reports from the second instances of these objects if they are enabled: the input scaling will be wrong and the positions will be mashed together. This also causes problems on Android if the number of slots exceeds 32. In the future, this could be handled by looking for enabled touch object instances and creating an input device for each one. Signed-off-by: Nick Dyer Acked-by: Benson Leung Acked-by: Yufeng Shen --- drivers/input/touchscreen/atmel_mxt_ts.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 54fe190fd4bc..48c5ccab00a0 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1658,10 +1658,11 @@ static int mxt_parse_object_table(struct mxt_data *data, break; case MXT_TOUCH_MULTI_T9: data->multitouch = MXT_TOUCH_MULTI_T9; + /* Only handle messages from first T9 instance */ data->T9_reportid_min = min_id; - data->T9_reportid_max = max_id; - data->num_touchids = object->num_report_ids - * mxt_obj_instances(object); + data->T9_reportid_max = min_id + + object->num_report_ids - 1; + data->num_touchids = object->num_report_ids; break; case MXT_SPT_MESSAGECOUNT_T44: data->T44_address = object->start_address; -- 2.17.1