Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4742209pxj; Wed, 9 Jun 2021 00:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI6GkcTfKnLkDORtUTLYONm04prpT78+jBL0iN7/6wp5d8NM3jzogHOfPKJjyNhP8qEPaX X-Received: by 2002:a17:906:c411:: with SMTP id u17mr27869145ejz.60.1623223033187; Wed, 09 Jun 2021 00:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623223033; cv=none; d=google.com; s=arc-20160816; b=n7k2wEwWBPK77Wp705irrrGrgXZ++G6MGOcmPtA4iAJVJcVK3sNQBrC9KfP6PjIohh YTHWzztr/lKZ7calDNOHklU5dWDsmctn+vaKdBs3A9SGF6St36X1oNj+lxHLLZUTjdPX lHIcvS70uxjAZ1mTE8QNEdDSvWzRfbFxTpNyfTj6xDen83T7VDyF//e71c+My0EM9r7T qO3qDwGLK0YaHdWgrU5eMMQQQ7qil5/R8lECiOGKSuBuPVqg9pi5zM23oF82+vdZBRbN ioBS5nIl2G1sLViaLpgXDeXCtcq7Tb12U60TTYGTCZYd6smXh1jfQb6RXaTwPd3CNNVX 2rQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1lszOWJC41zVKHgxH8J+6vNmh7yDt7GLHQgRRMZRs04=; b=y/ecqEvmD2WJ2lL5gAomyN6pgpfH5fg+5MaQdfVqTrbJ7QCAWvdPWvKodti+gGf/B9 1NcHnycXzMm4Z1xQFaDcKOW48oAnpZ3CYa59Y09wwFIogoPmSIwmsAZQyuHK4Z0+1Mvw z7Hmza5QkHfU2AkUJ0CtZTH1QYJFBu09nqhoqH8y2LzteIPYSTwbwe6eaiNeiEIT1L7E VTtf5s+uPIrzdK0g0Lfl9Ra3bEEhFSuZOGouFM7RoHWJStCa7e+LbU8/uDgM8HfUkJT4 r0HaZd+o96a356IAMrCVdiwJPukOPX1sixIBiRdGPFPAuo0h7VnFxPWATmgHb+IxRUsD 3/zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cP7uKP0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh8si2010967ejb.109.2021.06.09.00.16.49; Wed, 09 Jun 2021 00:17:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cP7uKP0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236293AbhFHSuX (ORCPT + 99 others); Tue, 8 Jun 2021 14:50:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235881AbhFHSpb (ORCPT ); Tue, 8 Jun 2021 14:45:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 031B06144B; Tue, 8 Jun 2021 18:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177421; bh=5Rg3zVXNGR1CUA+s3aHkRKob+1GdMsX8fhkPZmM9K/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cP7uKP0Fruli0ufFvpiecrjZxaZRDQ45EULRPGHSSPjYNjxKHuRz02jKSUEgxib9s apcLiz43mdxVD8pLLNhaByho87JSbCk4IdBuA4Y3TS3uGyciOEM7m0mYUulLjfBpCi mcW6jxMQOzNmx+/s7xLF+44zLrDpye1nDcZLmzXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Ahelenia=20Ziemia=C5=84ska?= , Benjamin Tissoires , Jiri Kosina Subject: [PATCH 5.4 46/78] HID: multitouch: require Finger field to mark Win8 reports as MT Date: Tue, 8 Jun 2021 20:27:15 +0200 Message-Id: <20210608175936.825750817@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahelenia Ziemiańska commit a2353e3b26012ff43bcdf81d37a3eaddd7ecdbf3 upstream. This effectively changes collection_is_mt from contact ID in report->field to (device is Win8 => collection is finger) && contact ID in report->field Some devices erroneously report Pen for fingers, and Win8 stylus-on-touchscreen devices report contact ID, but mark the accompanying touchscreen device's collection correctly Cc: stable@vger.kernel.org Signed-off-by: Ahelenia Ziemiańska Acked-by: Benjamin Tissoires Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-multitouch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -611,9 +611,13 @@ static struct mt_report_data *mt_allocat if (!(HID_MAIN_ITEM_VARIABLE & field->flags)) continue; - for (n = 0; n < field->report_count; n++) { - if (field->usage[n].hid == HID_DG_CONTACTID) - rdata->is_mt_collection = true; + if (field->logical == HID_DG_FINGER || td->hdev->group != HID_GROUP_MULTITOUCH_WIN_8) { + for (n = 0; n < field->report_count; n++) { + if (field->usage[n].hid == HID_DG_CONTACTID) { + rdata->is_mt_collection = true; + break; + } + } } }