Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4536390imm; Mon, 17 Sep 2018 16:04:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYuNe9VFjDY4PHGREJYpDvxbu94clH0icR+OhEkh60XRnp0X8jvKmIpGxfaP42fCfPQNiVZ X-Received: by 2002:a17:902:d706:: with SMTP id w6-v6mr26889629ply.158.1537225464707; Mon, 17 Sep 2018 16:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537225464; cv=none; d=google.com; s=arc-20160816; b=HqXNvds9ieqkAnF7clwl0D8NIOyV6Ou5bgAOnQlgKFgZct5c8sQTJYDP46AB6hkeI4 hT/QqPGKDeDqYOctPkHgxJDbhPbYGsG03hb8MoCwPPrQ/8AZao2c5tQpBCs6Y4tegN6l /dLzhSrmgG44eBeZH4OOxeiExj9oI2nF2K9Op+/Zuj/R5q4JoDnB1j8DqwSE3EpusQHy QDHf4j3woNRx2Pq4Wy0PbKxZfYMPoQ6H6+nnhzqtyFnJtQcMBCafOegGqfXWNBaCFNu+ cLd7c4lhDRGCirY4W3/+3qiP4P9U9Iit0HmYBPcQ8JFDVHz/GusCrSm9go4CeEe4/ZCW CTlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=WUWdMwg0GdDxBUJ+CgOWoM9iCXWxGQHxujQ5/eVMBls=; b=N4iqLQDPT3msYixCiH/r4exg49G85VP/VJg12tjyGrFBn03Abw4Snwef5R9cDT30L3 SHlp7QYkQiFHaS+rv2yn3vDGzf6MHqRFQL/QgtP5QDgq44xPja+tSOrVawnJB1mR4zse 4t5uIKcAcWT/mHIUTuMfgT2X7PZkibu6hberreE4YvOM2FcVyBoBz7n9Xoh0EZTXyg3Y zz6LpY5hG3zPd1Dz92LeiMfXCGqdYf4dQ233G29OYO1YPIZmnA69GjwWqKOgC4FH+Gou dHxelqui8UrELKIb7+zMd47cSFTHeis5aUX8hWjyPBFD6LwkT5y8tL+l/xPLHZHjirER H91w== 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 h187-v6si18401957pfb.62.2018.09.17.16.04.09; Mon, 17 Sep 2018 16:04:24 -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 S1730702AbeIREdU (ORCPT + 99 others); Tue, 18 Sep 2018 00:33:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48996 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbeIREdU (ORCPT ); Tue, 18 Sep 2018 00:33:20 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2DEABC03; Mon, 17 Sep 2018 23:03:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Dyer , Benson Leung , Yufeng Shen , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.14 078/126] Input: atmel_mxt_ts - only use first T9 instance Date: Tue, 18 Sep 2018 00:42:06 +0200 Message-Id: <20180917211709.286080838@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nick Dyer [ Upstream commit 36f5d9ef26e52edff046b4b097855db89bf0cd4a ] 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 Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/atmel_mxt_ts.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1647,10 +1647,11 @@ static int mxt_parse_object_table(struct 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;