From patchwork Tue Aug 6 13:49:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 13755175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 077E7C52D71 for ; Tue, 6 Aug 2024 17:01:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B35510E3CD; Tue, 6 Aug 2024 17:01:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=live.com header.i=@live.com header.b="Mi3ovq96"; dkim-atps=neutral Received: from IND01-MAX-obe.outbound.protection.outlook.com (mail-maxind01olkn2088.outbound.protection.outlook.com [40.92.102.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C53F10E36C for ; Tue, 6 Aug 2024 13:49:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NnPSWbUV0hszmPk9CA2LxTakjKCbLJ/mYEaUem6qwY/Kuj5elLNHFMWeo3AKBQN1U3ydAb8/6npRSeaVXiwvi5zmxQcHrgg+cIxXw1NXcUREtcWLcEDQxXjWpbomw3ewbjZQlRA9OD9tW2YdpRjSKw1TwrybmW71FsCH6eRM3lb8+f8sitHVA6XiE2X9IhgBXR6Qb7G8pY7ySuWXjhLYYf0VJzzpsld7wyaUlG8c3syYPw8wvfi5S2i6w6PYv4Q5XtNBjaannebsr3LKZhaL3Af8xDMM7HwMk9w/1yGnkFsPkxyeFdGjQlqGwHv8I39qOA5oj8O8/9GwUj7efflY7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LYljV6lQyR/DvSjvEVVSS69P9uNf1effmU5txH9sWMA=; b=g7Z22adZLB1R6S+CxSuRcFhb4k47dSGND8kn0Dj9DzKq8QNguFBsN57KtJjAZ0wmeTv7dqJPks2LIczszp25lHGyxd1pVR22OAGFPzkNGztjUqlNrWsHK6soKoj6oPouZvjuvwmJ+AuAabDCAR/LpSk1eXyUa3CyCVYvH07EPKnWOM6PyCWtufgywPGks1tmXqn13D+2ZTtprfHZceLkGKlJKGUXIYjCU75iUiC/UOBf9dcQVYUvMu3ZwRBVZZ0s81DHxEDxpnuj6B28EPvt6gP2aeHMft+ui4GLUbKNIOqj/8GfngpQPIvwiMLOmWBZhWGK0cMEKOQdd2/DuNMTdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LYljV6lQyR/DvSjvEVVSS69P9uNf1effmU5txH9sWMA=; b=Mi3ovq96UklNGgqpKoRgL88P/WcedwkU3LDdXGEsC0+hS9QKaRvkQd8K2mX+zYkzuWX9GayEC75FN83Vn4UJuK0sRksL/CoK1tsmtk1byuYed2wUqMO/HPBuaq0LI6/7snCij0adD320fT9eR0WVkoXxClyaddytoCEzHjWZ/jmOaR4nLPKXnUo1/8HEUBrvVszbVqk2wtO2IhyHorJKvtTWTHL8GFFrJr9CBolAOUABVM9BdJrcfGKehTlnUgHoCuxTvkeTu/8XuCuhMB4+7RudfpejzpcsYzcKk5eF9CoG7azXzCoJsSR+J6t1xk+Q29X0A7A/HMjl0JarcIPp/A== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by MA0P287MB1708.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 13:49:43 +0000 Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a]) by MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a%4]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 13:49:43 +0000 From: Aditya Garg To: Aditya Garg CC: "tzimmermann@suse.de" , "maarten.lankhorst@linux.intel.com" , "mripard@kernel.org" , "airlied@gmail.com" , "daniel@ffwll.ch" , Jiri Kosina , "bentiss@kernel.org" , Kerem Karabay , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" , "linux-input@vger.kernel.org" , Orlando Chamberlain Subject: [PATCH 3/9] HID: multitouch: support getting the contact ID from HID_DG_TRANSDUCER_INDEX fields Thread-Topic: [PATCH 3/9] HID: multitouch: support getting the contact ID from HID_DG_TRANSDUCER_INDEX fields Thread-Index: AQHa6Ad9lUj4/NPxr0mlo/9wuQYrdg== Date: Tue, 6 Aug 2024 13:49:43 +0000 Message-ID: <9223E804-286F-4692-9726-2306361F1909@live.com> References: <021EE0BF-93CA-4A37-863F-851078A0EFB7@live.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [j8b33ClWdm9egTSHGKFdho7XMt/KZVoeZDo1B9PP/inH5Nn2V+HlAHPqBHYApBkd7NTQXlYBs5M=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|MA0P287MB1708:EE_ x-ms-office365-filtering-correlation-id: 264465bc-39df-4923-5541-08dcb61ea04b x-microsoft-antispam: BCL:0; ARA:14566002|8060799006|461199028|19110799003|3412199025|440099028|102099032|1710799026; x-microsoft-antispam-message-info: FRAdsXC38QTpjeKtv04dEdLr4mEATh4Ij2CUm6tKJoaLJ31Mut0DVcC8xb9OR1bUPUK026gnX4Bl/IEigkyPKaShY9HB5b2P/QT2K72vAfn8XMil16qao3r1IWmUIp7+lOJzPwZAmTHlQJ9sM94UXSrdaOMwxCU/XNcSMP8kiz/NFQILB9B1EvUJ6KaoldW5vZ5vT7F9IykFN8HHisnGa9/PVff7c4AnEbJQz+ahyDia2w8Cittb/IF570xevP8s5URfYsDoBDgTAN2HF7PsoiWfNvBJiIeeAmhvOD0SRhw3GjqIu2aeWZVPwfbDmOxd6Ahu0fOHX/Nkxs60HqDqCMZfkqfQl00+Dr0y2M8ZaKPk56HkpoCVpKVJDQk9kiia/0Rgfs4hozGGZhi5e5mg2Y8grFfRGaWAX2eiZGko0cLUg+DMY6SyscZooF6NsFz5OMWvORI3z9KrO3jWdI6Hs7G4JAWlDyP3udoBQpQ4YQnjwnS+1Mi9oC15xmxduNhLDOeD06JeTB6OyDVfRqCs0uP92cOHG2+1W3FWGuxzp8n0zEPHz7UDF2QT7Y48TIQI16OkOiIKTg8GdhrJVpoQTnN2MBjLTPkri2ylCqAjWE+gkfZggh5m7B6o9AAytyIkZkrf2JwVtieV0AXtHGeMU2iCYQMLeVOVrS1gMY48vR0OuweGcQvpKLLQUNj0vIeH x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: mTx35u3Qj33nVNaf2sigmKnOoGZXPmQX48rLVH3AC7KHrpMIwK+MJOcTXxfz/+6UjwBrpK0w+OgCUJ8U7qpfLhylSz/SEj8BOZvpVIn2BnHRcjscjUFiUfoY/qN+xHRcpfsPU5IuY2oVuiB7wiBL+zk0nk7MrHZOWrXUKtQ5ryfj6tU5GteNZLu11/gNOtHX5KiOeKhfnfXxl/gQh69tFeMSkkLnj930DKDglHLSBt8XZdH97q8Y1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z3cAGaZyoEs4XHlre3 Content-ID: <1B5FF40860AF644C95C402CBE841999D@INDP287.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-bafef.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MA0P287MB0217.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 264465bc-39df-4923-5541-08dcb61ea04b X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Aug 2024 13:49:43.4208 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0P287MB1708 X-Mailman-Approved-At: Tue, 06 Aug 2024 17:01:42 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Kerem Karabay This is needed to support Apple Touch Bars, where the contact ID is contained in fields with the HID_DG_TRANSDUCER_INDEX usage. Signed-off-by: Kerem Karabay Co-developed-by: Aditya Garg Signed-off-by: Aditya Garg --- drivers/hid/hid-multitouch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 56fc78841..3e92789ed 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -635,7 +635,9 @@ static struct mt_report_data *mt_allocate_report_data(struct mt_device *td, 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) { + unsigned int hid = field->usage[n].hid; + + if (hid == HID_DG_CONTACTID || hid == HID_DG_TRANSDUCER_INDEX) { rdata->is_mt_collection = true; break; } @@ -814,6 +816,7 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, MT_STORE_FIELD(tip_state); return 1; case HID_DG_CONTACTID: + case HID_DG_TRANSDUCER_INDEX: MT_STORE_FIELD(contactid); app->touches_by_report++; return 1;