From patchwork Mon Mar 8 17:42:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?0L3QsNCx?= X-Patchwork-Id: 12123085 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 675B6C4332B for ; Mon, 8 Mar 2021 17:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 446AB652AE for ; Mon, 8 Mar 2021 17:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbhCHRmQ (ORCPT ); Mon, 8 Mar 2021 12:42:16 -0500 Received: from [139.28.40.42] ([139.28.40.42]:54258 "EHLO tarta.nabijaczleweli.xyz" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S229813AbhCHRmF (ORCPT ); Mon, 8 Mar 2021 12:42:05 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 78CBF360009; Mon, 8 Mar 2021 18:42:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nabijaczleweli.xyz; s=202006; t=1615225324; bh=YnOwl8+70YJN74o6JcKP3I+Z0kVB3n4CoIz0cKVjjB4=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=bOJP0EJmXK7FTiFBUBMaJTRDlbwQBsWkQfRJyMGY1/fBQW/eZIK5G6RF+mvEeuAOl DpwK6GLuy94+v9H9mDVcX3ycSwHBXdPSUIBxMRz3UKAYKbSQp5nua88MD0c/J50fBQ A56xmiWk9icDIWBNcHzJaFDzOmxeDau8IWJKk1VV9SIIoHK4JO8+Qt/MZuEK8gxT/G 5D1ALmtVgoml6jT1Lg9FpNCJnJ5ypE7e7G3VBnGEW5oiDE3/z7F4FJNZGoZBs8IYab Cn1Y/DnVkEnWiGF6mkF3fQc6j5FjVPQinPVo6d9ogMC6iivWiF4g63e/T611gMOyx5 Vauh6lSR0lpcA== Date: Mon, 8 Mar 2021 18:42:03 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Benjamin Tissoires , Peter Hutterer , Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] HID: multitouch: require Finger field to mark Win8 reports as MT Message-ID: <019fd182fe7358b14a2f9427572635e518cdb868.1615224800.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20210205 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 Signed-off-by: Ahelenia ZiemiaƄska --- drivers/hid/hid-multitouch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 8429ebe7097e..8580ace596c2 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -604,9 +604,13 @@ static struct mt_report_data *mt_allocate_report_data(struct mt_device *td, 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; + } + } } }