From patchwork Sat Aug 10 08:54:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 818313 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2046.outbound.protection.outlook.com [40.92.103.46]) (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 7F52C14B088; Sat, 10 Aug 2024 08:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.103.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723280107; cv=fail; b=OMR0Iw5T1Z0jLimFrZpMctO+4QK+TZym6Ppi6+TVhXcFsfD/rjWCcCztjhhCUEgRGuRtTUyiq4A8Db0YQ46gTJTtDCRSGloIEQN+6Bbz+1wPeRSMJbLL6R2RO2oxSRFkiYVhzPOPe0MRKEQfTs0pG/UiHh5UaCvITLTB16VU8Ek= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723280107; c=relaxed/simple; bh=wM5lJQU/XTPlSQMc3tjBBPl998jaf/IPW5DbGJ2A6IA=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=PPujyuUEyYqjkoiSAXkYcyez9HL8dTuNarcetXyr/1+tUVd1Xh/e8rCfCVyVuzMDoeX5W+/cGOcMXTOL/YirgJ+FPYQ2P6VR/5lmkqezGFl2tXbQwXd5DZFr1y4qxw4ArfgMGUMqGqhpzV5F3aDYAANKzmIjOxl2CZiRuNj+P/w= 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=Ir1ghTlZ; arc=fail smtp.client-ip=40.92.103.46 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="Ir1ghTlZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j48isvNTiSu7xKitj9Uubk2hUPjDEEn+RGhyFYDduOOHC4OLbldaUqa29RGtgteajdfanF/9Dog1QgJ2IAc4PtBDg4q0G+Msmg+a8Y7iWdOJidnZzvCDB15XaF8MNC/+/I1J5uPbdptVfpIT7hIP1SLuMesKHSr8HA394yDGWylKCGxblj3TV08sHUjbO2G4MUzFB+tE15DnnVCoAU94WO7Bi43ff+ws54F6PKvfp9mJPpeZZPP96XNnaEn7Jr9UQxToDM54LslsIjDI2TwS73lQEANvowZ4yNBPMCtxsJ0xgAOwxIWFAwk8vRbBr0siKJRKYQ6obgKJqT66Ut5L9w== 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=WFlmNon3cxCsrA/dn65ztpfF+V3XRcHR23mKlXxL7g4=; b=DPrXZrrv3qxJiARX+nlQyY11g+uhtuKfCk3R594RJqVK4xVHtRUirABn2yVEJAVv1d9n9uebdY2x/wTjmdw8PRkMSpJX5TiWFgD00PRhlREsjcX2DbOcO1uJZixwi44VwCvwZIqlrn/PunltkETifhalgdDd1zj8XcEIFBU6TxfHFcuemhOIaVQYTfLRnNqWd+gvZF7QERMZg7NpA2uyM9XHY3hCJP6A/bgOupUqbkGmP+EbCF3rOUPj4zSS+4NnB+K9SBbLPCmGxVyCZhv1LGFYIXUmbOv/uHNDZezIkNGkF5JsbzuCRyOJGfdvt0BPm3rIqZYgIIKk4Fz4FtUIfQ== 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=WFlmNon3cxCsrA/dn65ztpfF+V3XRcHR23mKlXxL7g4=; b=Ir1ghTlZq/Vv1XcV+0O8eOS+6OkW0Pm2Q/e6QxMdqe+4WSozqcLaHObb2yVz5FuxOn4RHdnQOTSP6iojdVd76+ivaYYnb0Mn2B5SrRi+4ZcECEY4W9oJlVm1v9BiOPH3daWERZSWo0DdHvB4XgNWJBlJNca1xrxEQcpripRksvpOmZNb//2PqIhKN3UGy5BzDLSGAVfdMkqb8tsXExcumSV9svCqW7tHShdx5DLLDW3caPz6kDW/Nsvh/n+ezAnF6y7Av2Wiik/hT7FE6kFqWo8lZaIuZvq/4pYYxw1K7KHQimv94s7y3LUzAn65aE5QDQ5OzkneeLopL4ZN5f0czQ== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by PN2P287MB1551.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:1b6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Sat, 10 Aug 2024 08:54:59 +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.015; Sat, 10 Aug 2024 08:54:58 +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 v4 8/10] HID: multitouch: add device ID for Apple Touch Bars Thread-Topic: [PATCH v4 8/10] HID: multitouch: add device ID for Apple Touch Bars Thread-Index: AQHa6wL6purUB/x39E+brePYK0cOGw== Date: Sat, 10 Aug 2024 08:54:58 +0000 Message-ID: References: <20190CD7-46CE-400D-9C58-29798479660E@live.com> In-Reply-To: <20190CD7-46CE-400D-9C58-29798479660E@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: [KrIc45PMuXOKA5rNHK/ZPIqMgcP28UeXDIlBGoeKCxh0d85h+cVmMj53K/fhNOvwLSeHtum/PfE=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|PN2P287MB1551:EE_ x-ms-office365-filtering-correlation-id: 7998e165-3d31-447a-92f6-08dcb91a1cf0 x-microsoft-antispam: BCL:0; ARA:14566002|461199028|15080799003|19110799003|8060799006|440099028|3412199025|102099032; x-microsoft-antispam-message-info: NGz/9/LVGdU+PrKfHlXErtiAgSdxSEVzlqEmTi6i1GEs27phzEKEUpcfO0aOF7CONwHPUHXx0oHz9GTk09xvgt0OoIgfaNQuLH469W7r2xsVTqdUqG/i6aHY5WjPBspkAJQwAfHi05ls1EvIcR20+ZLSxYDriCP0XnB4HQDQKdQP4x4ldo9EcNyiQLqwUONhdg8ey1c66uFkkZlI+nUMfFQkZt7C8oGMx6cIxxn9UJjm4LKAMKDh/dVIdH/UEkSSkixaUntUZoX6wHVTA7TAQK9y60dQXD+ZR/FlCjm4yPtWTHYGq9GS0R69oQYZHLcqyU0A2ue/6PFuGOxsEJ4aj6amECRWDJbDpOGCBYttgOnYboGKX9WCg4OR6UaXOr8IqO6SAOBz7KXQg10gSUipYiTtv2ysRnyKpfffhmoeV4U1Sfsxan3LwHARofRbQEKeqqGudnJCw7W2Q06RJgEMtp4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rTGNtQ4DifWqQzmpAGxwgYA7G5aRIQ2+YxekrgkO12VQF1FD2SuBCkeQ8lTATcqszfJMMj0B5T0m4LTL3vcOAIRTqFxRFBPDvRSsSKHvGO832Rys62KAHTCsVB5OsPG4VmhUopO3yeCJCqZ2jcnhNIB7esTN96SaYA3MdQo0sRZBXOV5jVAf1tBzqBaRhi1RBTcGo8UaIcTLS75xX+N+mkgG2IlSkq1nNpyYxqQQxjXVv5kePVMzGLyTYMsl4QQqWupGkdLV5+RV66LtYZT9Df0gcwrri1zNiF2vyt7j86kK+GJ+WR+0iRotq8ahjWIfTmJeoyKr8jlPpO/9BflV7QiS99qZLz+hrLiI0rg51eEXKYsETsTO89jqU94UxtmGb3Sg5I0iLIZxhyJw4FguSP5hx3pXXV7CS3p//kE8cjEqxgmhbQIJj/mVxJc0EAuQDchJFBOQXX9/tp42diyEZiWtJaj75K7CcaI5hdSDH5QF6c9aMGj20+eGOccLyuyOe+U6khRnabHUZWvuMowxLCL7wicX03S+77iE4Tuz/24OAxT Content-ID: <1A9F5EF64D5B5F4E939B2DE2CD208F07@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: 7998e165-3d31-447a-92f6-08dcb91a1cf0 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Aug 2024 08:54:58.5469 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN2P287MB1551 From: Kerem Karabay Note that this is device ID is for T2 Macs. Testing on T1 Macs would be appreciated. Signed-off-by: Kerem Karabay Signed-off-by: Aditya Garg --- drivers/hid/Kconfig | 1 + drivers/hid/hid-multitouch.c | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 72b665eda..35ef5d4ef 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -744,6 +744,7 @@ config HID_MULTITOUCH Say Y here if you have one of the following devices: - 3M PCT touch screens - ActionStar dual touch panels + - Touch Bars on x86 MacBook Pros - Atmel panels - Cando dual touch panels - Chunghwa panels diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 2948fbcbc..0fed95536 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -214,6 +214,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app); #define MT_CLS_GOOGLE 0x0111 #define MT_CLS_RAZER_BLADE_STEALTH 0x0112 #define MT_CLS_SMART_TECH 0x0113 +#define MT_CLS_APPLE_TOUCHBAR 0x0114 #define MT_DEFAULT_MAXCONTACT 10 #define MT_MAX_MAXCONTACT 250 @@ -398,6 +399,13 @@ static const struct mt_class mt_classes[] = { MT_QUIRK_CONTACT_CNT_ACCURATE | MT_QUIRK_SEPARATE_APP_REPORT, }, + { .name = MT_CLS_APPLE_TOUCHBAR, + .quirks = MT_QUIRK_HOVERING | + MT_QUIRK_TOUCH_IS_TIPSTATE | + MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE, + .is_direct = true, + .maxcontacts = 11, + }, { } }; @@ -1747,6 +1755,15 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) } } + ret = hid_parse(hdev); + if (ret != 0) + return ret; + + if (mtclass->name == MT_CLS_APPLE_TOUCHBAR && + !hid_find_field(hdev, HID_INPUT_REPORT, + HID_DG_TOUCHPAD, HID_DG_TRANSDUCER_INDEX)) + return -ENODEV; + td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); if (!td) { dev_err(&hdev->dev, "cannot allocate multitouch data\n"); @@ -1794,10 +1811,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) timer_setup(&td->release_timer, mt_expired_timeout, 0); - ret = hid_parse(hdev); - if (ret != 0) - return ret; - if (mtclass->quirks & MT_QUIRK_FIX_CONST_CONTACT_ID) mt_fix_const_fields(hdev, HID_DG_CONTACTID); @@ -2249,6 +2262,11 @@ static const struct hid_device_id mt_devices[] = { MT_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_CSR2) }, + /* Apple Touch Bars */ + { .driver_data = MT_CLS_APPLE_TOUCHBAR, + HID_USB_DEVICE(USB_VENDOR_ID_APPLE, + USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) }, + /* Google MT devices */ { .driver_data = MT_CLS_GOOGLE, HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_GOOGLE,