From patchwork Thu Aug 8 11:56:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 818337 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2052.outbound.protection.outlook.com [40.92.103.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9701F4A33; Thu, 8 Aug 2024 11:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.103.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723118192; cv=fail; b=caxEd9iZLUAwFfyJyUIlgtO6fcjxUhnEFwGNF7Jlb+Fk3HFvvrWEreKsnh/Jjm2ZvKEUxFSz9maCqxSkX6edL57GTnJaW8b+3+t/WM0cCDepMB0JP81HiHuTTAUanDQ27I1fY+RhLF33nWyOrmXgFjOkWnVJ8o1zmDa7/7FgtPE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723118192; c=relaxed/simple; bh=JSkjijAYgzH7WQ3jUUHmHMdD6vO8+MXa8Wh7CpofDLY=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=AEvZ7kS216OE1C8ANdtKM3u1e/jE71rigXfdBZ01I0euIBkn6MVtGbeusPJALliWLiUD6a6N8uR50r3r218WY0j6+UcTTr4nu66AfgqJFEjaCAYXp7vDIzr1csygdEizIEz7PRTP7QIW42Tl0V6T/9l9x0zr6tRAlOOlccdTMPs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com; spf=pass smtp.mailfrom=live.com; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b=r4Gd8RV2; arc=fail smtp.client-ip=40.92.103.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=live.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b="r4Gd8RV2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PbkmeLgDB8j4gvmeSjSEU25acE/3EdrMqlm46YroseRar5gF6wk9g01HeLRaVzB2d0PEpAufj8leAb756/x3M2p2uSH8QtSJ2hetNVJBWTl8XP7O5EoYbL+wHza4I+j5U/LcNghkfVBTxXIDm81Hyki4ThMTf+I3ASU6i8wao8l8fZTSF+awL/J66i2zPsa8qCg8n7LaZ9FPr9ktmbgurluxdUmhBerR+iUZLgyUoN/YaIx1yKiwd8hMgKSIFzSqthJNVhyKiXwwoNzLQA86BZ7FJ9Q/LeBBQ0sg4mhCbEY5ySd8lu95gd/YJ0ITu/PYxrJoqnEYIi6w/hpiR0G0rw== 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=p4PHen4032PcthKi8HoFeGPNif8f7CRd94d/mUAn2RY=; b=kQhQGCryoUWptdH6ZC3AjBOMhrFv+I2gZthuuy2GB6BWeI4Sj/vdTfobJHL42mBd3GfJ36ToGwg2oYbZA7RnVZ5bX6YesmtSB47d5kc4A1fsUfR3AVB3Vbfrktu1xsflCiVrRIyGqcD3D6DhjuoTdXVCShWQCq6JYlROkw/HJbWWXKwGPUIwM6lW3KoveuViIK9ePyMc7Abixc0PpstVQoRGcwZ/+eeZtbiFjFYGmflwtscKz/YyTcaoPfXQS+X+BpHYkmvaZ4Pc892X52aKuiIOKSTUz9aJ2pcqMODTWTZwWeoIX2voTMXk70FTaTiGygFccEvW0S5tP0cjHQoDTg== 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=p4PHen4032PcthKi8HoFeGPNif8f7CRd94d/mUAn2RY=; b=r4Gd8RV2xWWNS90SF6UtKUSaRJm5mlvvPCPqev0aVXKj/aYL5/EHBq+7js2QZCo5/+OEo+mJtElToM0wZ90Dn8kmkCtKg2KO9rnClKhgqwU23/dJ0BUYE/jqk2I44PZPqtE28T3DyedrL1AwQlLCkOPh+qjcReg4s3GVAlB5eUyD5aEarQMwCZijlXLlK4c+EDPdw9M9bxebRkZBOiqUg64q1C8epdnv7yHdlXyroefRsDfL9JH27NjWXiqSP9qhNpolrz5++S9TTDxYmJhDLLu/tAguKHr4/0jlxjoPoHUNUazhzlFeVBPj7giRCx5wnxwLnSfPRPSIGsImMhoOHA== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by MA0P287MB0066.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:32::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14; Thu, 8 Aug 2024 11:56:23 +0000 Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a]) by MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a%5]) with mapi id 15.20.7849.013; Thu, 8 Aug 2024 11:56:23 +0000 From: Aditya Garg To: "tzimmermann@suse.de" , "maarten.lankhorst@linux.intel.com" , "mripard@kernel.org" , "airlied@gmail.com" , "daniel@ffwll.ch" , Jiri Kosina , "bentiss@kernel.org" CC: Kerem Karabay , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" , "linux-input@vger.kernel.org" , Orlando Chamberlain Subject: [PATCH v3 3/9] HID: multitouch: support getting the contact ID from HID_DG_TRANSDUCER_INDEX fields Thread-Topic: [PATCH v3 3/9] HID: multitouch: support getting the contact ID from HID_DG_TRANSDUCER_INDEX fields Thread-Index: AQHa6Yn8D3YBQb5sakG9oCUs7mNuQQ== Date: Thu, 8 Aug 2024 11:56:22 +0000 Message-ID: References: <9550ADFD-0534-471D-94B4-EF370943CF80@live.com> In-Reply-To: <9550ADFD-0534-471D-94B4-EF370943CF80@live.com> 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: [0UbDxD8hIPHAY4pNGspzs9VBZwvOi+FpGEbdVrNq9mVPYIMfQkFK+QRCrOJMEHqf9C45K3x3QPk=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|MA0P287MB0066:EE_ x-ms-office365-filtering-correlation-id: c6803158-2f89-4814-a495-08dcb7a11f61 x-microsoft-antispam: BCL:0; ARA:14566002|15080799003|19110799003|461199028|8060799006|440099028|3412199025|102099032; x-microsoft-antispam-message-info: VMOp02w+IkqN4chi91PxK26h7UPtDNZ386lI2i2pQ8g7LWyBwBn5jt9a+qyfqk11/fXBfT1XOaS+7KXrTAjycHZ0pYTTHr5JlI/gz9ldCBBzMIZufkOFG1Zl5XMrLuUeQLL7+dVUAQyrlgm+FxrCdMaXoAwz/0cyIm8bTHYFmFwee4eqC2vjDwYQY0z6DA15NVUaZLEQCkFeI+I3MjDJsrIKeHfu8ypE3vNMy12TekhhFA6UOh4dg4oRzUB2SIVGjBsaFRFHgsMCmOwC/QoNby1EWNLOfRsFNvihPFXGdfMc1TP4GHniBM/OjYunb36ZEI4M3wlzwRRn23V+ajCbJ+Yax+IE3QmEZobst2OVwpL2bWsiFVfWJfLVVqIbKkGdEyJj1QTnk0IwPxD9XsRjbDo8HwfJ4vNNNW3kpOFEoBxPUPyXqalN54pMEy4QUO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A3iEZ6dkS0eq+09ZWMIBu0wlueBjTxgfoUBiOXCW84cbAdTK9LU3UcHWyKrzVxoBNZgs75PNJvLUxoaVRr/H+Rd9hMUPeqcHClGOOucvgXbwrYcDByDYWTcNt8oaRSO8Yk83RPgqvWFZhKeU2F/cqg9rwbFQWaLC4SF/SLElYKUZwVw4gLzpPVi5t6ow9dkN8EruOADGGFRPxnNrU/5W8b75ptjCJJIbGZ3ZA6Nt6mCPRhp9hWFTwz5PtOByCsStXMQ6R6iX0w058k8yRgPViDQPA+TRrcJA3yDeyiv0A39mB+HFknjyCIsu6vAomxID/vQAH5NplCWGeCYuoNlSAVG2UZ18EF5pmWa2XMIVdB19khFc/1llOTdHi+c6WnHEyjDB7cFKrL5+8tWejvdoQCd/RKlWTAyNmD7w0Pi+j/RME1meJLJ1MvI/Dn1oLS9y+C1xWmp+Ik1ulPgS+g3YbHMFGZWuw8pUQ0WV+lke+bwYiSSr33d6dNgYyjnLeejO2Z83bq+RFaY535WJVuCZ5KGEwxR+X7hq/+IQiG+oCGNdtwRZtuicqaQRcJbLvF+ZZ8/QMbiVLf4q Content-ID: <51AD6AF97EE1EC45BE44B1C1DB7F0F3C@INDP287.PROD.OUTLOOK.COM> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-24072.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: c6803158-2f89-4814-a495-08dcb7a11f61 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2024 11:56:22.3273 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0P287MB0066 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 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;