From patchwork Sat Aug 17 11:48:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 13767163 X-Patchwork-Delegate: jikos@jikos.cz Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2024.outbound.protection.outlook.com [40.92.103.24]) (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 A3C2477F10; Sat, 17 Aug 2024 11:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.103.24 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723895296; cv=fail; b=f2rQ+8NYLp5g2g2jfW9WEA+Y81gc1f3QF0FHadci8zl3tOlLndWFzDkeGiEGFDacbsIGxcBqJTpxbvQVzqDArGXf5AhBuSgjLPkfr6WPYCiQEe5ZHNNBvxVPsdBLV1AHLpi5+z94RLw4D9YKM52tgtT5Rwc6ahkJ97iQZzMk5zc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723895296; c=relaxed/simple; bh=ksj+9kigbAd7lgOyDE0QH31QaRW3sThCErQrLWY2ocU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=oRgmn2AXTO1EQjP/HC/Y/kk+oZ9YKL7/PFDIB62Iiu787Xneufp4834Z5mX4lCbfr6eqM6k3jRpRjy4L252y2WoOrG6xMkYN+TlKBS6EpLHlNFvp/sF5IfxYCFimpYpueL40eGTRu5AwBSxY8NiogKxWcWWwlBBGBWtusG7XLuc= 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=XjkbhSN8; arc=fail smtp.client-ip=40.92.103.24 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="XjkbhSN8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q9zKwqQ69HvNRmKqXfxekdU2O8GKUHL3FJ+K8zHZ2h7Mpk0/lq0HgnuyUK8GnfJZQZ3s0ROlKIU3bduG2WkGZU8mbP7KuX/vfh+SKRCtxVPb/u1XTfwrw/Gxi8/Urt9LDUGCGJ370Ntv+Dq3NXcC7P0ZuZiVRAPifxoT6AU/2YCjLyU4OehPbB5bKJim80Hq4ybYUriXdwR+u904bEhoogrfYGGM5BiN8KmX1eLrn2duK6Nb4HevQB6nYVzkOAtf++lcppfGyIsAgB0sl1JAk9iIlGxPxv2FtUP4zmHTo39mempN0orWbz3QPI/S9TOtJoElawNM7p4Q2zjqtJLHCQ== 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=bzJQNbir3aksonInPunSVUKKA+KLTVCBzdPlbfwum3A=; b=ezBa5SuXo62e7ASomopRq1CcIGTMHUo5DpzvmMIRuGc34jswjuj3xvqiivTn9PYB6wVBoePXDisbI3VqMdee94TkAXkAQFo9j1LwoFB8hOGeiBOBMH5GMQbDBdaAf3j2GRmYUAso7fHnG/4DSdODAYetyOSChimAeK/xccUsX/SHh8qtJ6n9EqFMUIe4UWIojhviK2ZBfUSPbSXQRc4ZWWBHAY6ruxnKbuFp8dwNr1i7guPBoarL5fVw1Xj36uhwrI54s2jzy2Ls9yr+lslSue3idpGtsRKBMUSGuLUs2+ujiYekJ0ojae+WsrsFoh0HiDrWWBVZXJbSOR/d4bZgeA== 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=bzJQNbir3aksonInPunSVUKKA+KLTVCBzdPlbfwum3A=; b=XjkbhSN8k8Jt/ioJ2XsNbKN/d748SJNbvUxZ6JrRdzxZNUF+NHCYh1BdUDeStopefXwSzCljKBTCNGk5Rf9tf+DfhapiwoY3w1MHiSORSW0jKlNs/4K4aZ8eMW9h7aFAdZZM6JKilHdh9PBV/gUiuO8v23GKvMD2+yrw6AfB3nVehEEKNpnTib1gUMledVAvvB4FWgD7IPEinEg/uzXFgf+2HJEiW0aRxCI+w1l4FbYkBtrO+Z3PgsFy4SBdsJIAKrrU7fCsHi/YWDXG0YXKIN0F/TP82GpWESV4Ych2lHQxevZfq63Ze716tgRCRTTWQbKsNHcrItm91oKmtWhlWw== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by PN3P287MB0241.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:d2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Sat, 17 Aug 2024 11:48:08 +0000 Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a]) by MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a%6]) with mapi id 15.20.7875.016; Sat, 17 Aug 2024 11:48:08 +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" , =?iso-8859-1?q?Thomas_Wei=DFschuh?= CC: Orlando Chamberlain , Kerem Karabay , Linux Kernel Mailing List , "linux-input@vger.kernel.org" , "dri-devel@lists.freedesktop.org" Subject: [PATCH v5 4/10] HID: multitouch: support getting the contact ID from HID_DG_TRANSDUCER_INDEX fields Thread-Topic: [PATCH v5 4/10] HID: multitouch: support getting the contact ID from HID_DG_TRANSDUCER_INDEX fields Thread-Index: AQHa8JtUUasJfYprSU+JVVYDuJLkBA== Date: Sat, 17 Aug 2024 11:48:08 +0000 Message-ID: References: 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: [S0VX+XTgBOMGSEKDCck97VXZiPl2R8k3CzAVo/zUOKApfuJWmfZaTHUwVFGXRmQMJcCJnz6NfYE=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|PN3P287MB0241:EE_ x-ms-office365-filtering-correlation-id: b00e6bd8-42f2-409a-75b2-08dcbeb276ae x-microsoft-antispam: BCL:0;ARA:14566002|461199028|15080799003|8060799006|19110799003|440099028|3412199025|102099032; x-microsoft-antispam-message-info: 4dT2Xq1nb8DHcy9EMaVy32OuJi+t6fkpKoUxq3DJ44GsOriLapC+Nc4k7ITdBd12/PIvywluFs/bo3vK8P32RO3sJQ/7qp9QRrCdZ0Hs/HeWnNFNMOLeEu0hEm1YWNSz68PHSLVJq/f2sHnpQmqVcLWEG3wpeQQeCwiNs/of4I4/poxmQOIgWYUwFxF9ySpXuDw6Z63DS8NGlEeE5sQrhpP72AcOuqVIGCw2gSQUErptQELrYFB137fwl3ZKiIcKmxnj630Zq9G/05wuNM9nqK7z3uqB7c7GSTFYtX61aNLpavct3GtAFDZmH8l4oBwbMK7g23KPq6mi/lGMdH1Z2wTtDexHII8xu0avC7OOeMYUwpdYl/stwh3UJCH/7uMG8eiPQaF4PNPXR34xUqAXxygLrbt9g2OJ8M2zLsqBWVAEu86/PRs3BGOSFNfSksgRttWzsjcwSAEscsHksTMDAoHDF9RkkvjU21LN+vnGBQauM0bhNwC7yLcnmeWsbHmYUeNbKDaXs3V4H4WatL2s72aEHXnVQ8udcnClinn0aaTEidY+NSNoGidqo1b5fGZqSdeoJ9jZVVFc9K+d1x3r0JFKQe1EKIpXUx9ey6wXPdI43jCi+/Mel9ffmlBeg4wE8kMNyhOL4l1GEmpjRs317yWuyPoFGSLTJz4HNfDNGSEN+cBMg2g66RxpHOOtGLeZ x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?uZdfrnmvXEb58+TYL10OPUy?= =?iso-8859-1?q?tiqOA8oNru0kPS/GJr73DTF/YlzasbM5TAShdosCOpiMlaKKF1qiRq84boN2?= =?iso-8859-1?q?xp6Vwa+w/JGxAkjrVJEizGuGkwzjJcmURhVbdVDWGZhbMbDnBpiIEfrH1KXc?= =?iso-8859-1?q?tel2febq4xU7fHA9eeMJNuoD29hHvjV3pv6t0KC8zOLIwkSbM2KJCBV09V4R?= =?iso-8859-1?q?jFcghiI83RZIFe0hiZuwZxbE83Bh+MiYudIrWtgZbQ+MIA+VBngEWc9BNK/l?= =?iso-8859-1?q?bK7dK873Oc7bp6lCXOM8ePYeDGZydrw1PoUgq6QUrJYQZMg+LMhJPaU8zC9P?= =?iso-8859-1?q?Gl893nFEvW6c8smbpjUJleef1+hwDeAg9+DSVWPCe8dOltzjtO9TdpvAlX3n?= =?iso-8859-1?q?N6I7j2rL6qI55Scb51HCTWkSTD4HLev8XGfZswcpIqCPwR5WwT7kMbKgzUEx?= =?iso-8859-1?q?ecvZisSNVhRMZ8MOq2Cn4EObV2rNfac7mlgXSHPCF39gO+UD0GJnJzIBVIfx?= =?iso-8859-1?q?3tv1EY2PBt1hlZadiFzlPX/5vwgkGxmRE0rFcyCbYb+20AYBR71a0LeniyEX?= =?iso-8859-1?q?G4R+AkeVSPM81cZQ8qDUENQin+fT82i+Ov5wSue3uH5RTmVh4foPFIoMTfFm?= =?iso-8859-1?q?TPr2WahfK57zX5EtY8KKebPUo8w/HRbPpF0Z7UFT4WSv4VMqnj/MackuqCMf?= =?iso-8859-1?q?mwqpVBaepqasg2qCoyBuVWiOalAeIvAKRTOA+K029Ii+xL8l7oFfOpjw4oQL?= =?iso-8859-1?q?Pz3cc5YOcaSMawKTabQBWqw3dsNmotgmy3k20jW7hwe//wH6zWvpnFJfhv7k?= =?iso-8859-1?q?5+3GUWakL8HMSJE2v1/KDfABwi6oGEv6j4yOHKL18UdVo6AZ7EN7oVukcegI?= =?iso-8859-1?q?JXUVFk5rgjU9l+4p+bF3TjkMyhcel4IlCvIJoohNqdhqGQtZCb7L7IzGWZ6d?= =?iso-8859-1?q?zOqraGMD+qe6PQMAUmrRMMmzBAwzQxpdT1D03IOB/NXWde9x8Tm8wUPQHUKv?= =?iso-8859-1?q?7vROFDaF0MYKEs6tVCCReQC/Rur6Ximc/q3LtGN2OHHoxbOVEiEWYtyZt705?= =?iso-8859-1?q?hen46PzTGef9d6en5BXXK/Jam3TT2mG9IwIKSw3Tpg1sOSRBSGNtt2L7OQi2?= =?iso-8859-1?q?F6fUeoU1ESR02sK1OX5Nv/y6qC0oPGg9veVZ+Q2alHYqPJVTcCOSuMq78L//?= =?iso-8859-1?q?l6bTB66n92dilyPD9vHO89cqdkis0/4XBDQ8j8JzIq1EgHQz32jGJXtBRk3j?= =?iso-8859-1?q?slKLKTuqoRlxkwGk7mpCE6+Hzr4IIluJq35NhseV76gGPfep7HYLdF46VAV4?= =?iso-8859-1?q?g+XZvMC37vojxumQxnkrst4J3tq/vieUhincor0WJWdaOZl5T8ZdeN/0bR/1?= =?iso-8859-1?q?I?= Content-ID: <359F22DEC835AB498FF3F448CAAC57CE@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: b00e6bd8-42f2-409a-75b2-08dcbeb276ae X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Aug 2024 11:48:08.3902 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN3P287MB0241 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;