From patchwork Fri Feb 10 03:41:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 652593 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92C57C636CD for ; Fri, 10 Feb 2023 03:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbjBJDlx (ORCPT ); Thu, 9 Feb 2023 22:41:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjBJDlw (ORCPT ); Thu, 9 Feb 2023 22:41:52 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2095.outbound.protection.outlook.com [40.92.23.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D8B0B447; Thu, 9 Feb 2023 19:41:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JTYFsQCKddvy8Eh8DB1Tl50zmMHzZeZT3rVNrAVcq9uT8YSFRnv2jqsmiAQ7DKqp1Ftk8U+pQOEq6HeR5DOFZC113k9xR12Es/Sq25ubM0ZkEbm/bo1uYJC1LmN4MYrrbx2S+JdN3uOeeYNa1D8mVkE9laZstd+AejiLAp95/7snenl6OWe/+oXbhf+aiiZPASNEUhL1o/XT7RQ35fmFPpsOMv+tgHcyO+hGmtjsWdNebfMLH0t+ILcWSJRn5E2va9bis77DBbeL3s8nNPI1C3Dn0AqjRTN+Lqu1TYnIagRMLfLCzDVuc/z4wDQ/QBkn/c7ltfEQfX6iFAQDZemr+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=qYLrxwCzAgaIBrJ/Y8+mlCbtavcgnMndawta0t5bdXg=; b=VFuqU0PR9smjGSgzUs+U8YRTSZeYDF0pC/XY7JrrRBGMjW2X6eaMJcXy2Hbbq+++wVdThPfCYNWby8bYE30gBiKrPa7ZvpPDKO33EWhmZhRhkN+oCU5WB67U8wDDzsgNc3VhF/m7q4wZOeF2bb+GW6Vh2w1/w87h3X0NZCPwtJMubgTGbW/0hwBtYrCavMlSq4L0Nlc+Zh9KL9zTyE75on9ZOxNR7MBTzYQn4FOPmPifQxzYbLgsxq7jH+qxFiPdhDHq93/8/C+U1H+z3knPvzaspNY4lhgBMEjqfOMr1H2DFamx36o4smTdbDu43Zyd1ghVZ50gtnR3dCEFYKjsbA== 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=qYLrxwCzAgaIBrJ/Y8+mlCbtavcgnMndawta0t5bdXg=; b=mKlnp8+s7W5zi2J5W+zG2ys/ufLIi4jzV96PNsJdQXG+eb+HvLyKeRcueI84lAAYDWVBHndMHox/Y5f1tewSH9M8opjs52Ys4+AGnmOritxYlXf+25H3UV8TS64Bc4SgE7mkBxfJcHFSBlUSKRbA65cC3fDPVcGvQUIHDmc3VNYdnwy/faYYAA3sDUnKkAYXv3NrP9ay4KWdsZ345w5ol/UGP+dI3L7yvhWNmxGYOtwWcHZYnoLBUdBTXaOjQSzcLgrSc1Va6waimLgmE0wCrK3nhBo/jOZ4O8haL+smHVTqrhgKqjr5buf0HlBko6sElpeWTuSLPRWrZGG5C+JXCQ== Received: from BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2::9) by MAZPR01MB5554.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:61::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 03:41:45 +0000 Received: from BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM ([fe80::9dc7:9298:c988:474d]) by BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM ([fe80::9dc7:9298:c988:474d%11]) with mapi id 15.20.6111.005; Fri, 10 Feb 2023 03:41:45 +0000 From: Aditya Garg To: Jiri Kosina , "jkosina@suse.cz" , "benjamin.tissoires@redhat.com" , Andy Shevchenko , "andy.shevchenko@gmail.com" CC: LKML , "linux-input@vger.kernel.org" , "ronald@innovation.ch" , "kekrby@gmail.com" , Orlando Chamberlain Subject: [PATCH 0/3] Touch Bar and Keyboard backlight driver for Intel Macs Thread-Topic: [PATCH 0/3] Touch Bar and Keyboard backlight driver for Intel Macs Thread-Index: AQHZPQGZPHmOr7bJ2ke1lktvnMU+hg== Date: Fri, 10 Feb 2023 03:41:45 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [BPkq9N1xH58gZgFypXoqeqYW7QARpENP] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BM1PR01MB0931:EE_|MAZPR01MB5554:EE_ x-ms-office365-filtering-correlation-id: a027e547-735e-4cc4-5401-08db0b18bba4 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1ZRNDnTWtlKVOKa6edZm/XKwifPH9v6FWqp6hVddxqeL0EVvh+PkzvozThq1ILFIlk0WnrBcUW7j+erwSg3eb1rv5vuQvQwcp0abFPAazl2E9l/czQvFpwp2pJIExbxl5UIulepKwQecaFFllH+nf70e9zg4WJ4cW8bPSS0l3m0zwmPu0+EDpjxlPPWJImUQSN5P7FbsDHU4u3Ae5WVlt15rtsjS5BLFXxknz30QGSfnddO5dfbR4RMkCSxfRLinPeHTaaSt0jzFi2DxLZiVMsbw+C0B58WrHTsu5myN1SETGOrbh9+Y9QXkSHV1ZlqR4sm0V+V/QOg32OIdZamrmpcNiL3O+M2km3CxxxiJQnlBx+9lM9upXPVpT95OcFicp/lUbgKui4Rm1JUzA/objiGIbQrpRVUJab+hp5DL98dqXqpkAYg+7wsiR4RV1ohZnv4ylWG6g/3hsCe/mOoipghIN91EpHZo9X4H5uYtNibaAMk34I+PlLs1BoJBCmNEhYnrXB2iPXIeGuKyMlMaDgZRsSu9HK2q+bWqCmNlx/p/DQHYaUBV7Xo0+NlHhOxxdy7XvR12RmrCqJ1VOIKyKg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?lhne31H4Ml1uH/huD1/UDRW3Hh6l?= =?utf-8?q?tK4lpKOR6hYi6tAdGC59x/sUvH1D+7ns7pl9g+BZMjsP/OdUHm7hEcJzNq8Tmw5GM?= =?utf-8?q?MnXBArub8CI72vl4ZqPxvgT9yu8405RHl46TydZDDMC7LU+C4z6beM/jAyeaRY+yR?= =?utf-8?q?o0CktYI6E03UsgVwiRVHN6tqZOabG6fPmxiThE+5wLIubRNQGdexGQ/1Tq0RTfbuL?= =?utf-8?q?BktKKb/AAdmzaaiNRYzrWRNFTlxkSamFORvEhJWy50F6tBT9ayP+D1V3l/w8JEhc4?= =?utf-8?q?7JLEZNDMFDPB1z5OuLdceTp36I6ldAT/laivstoX2u6TB0AYjZMh2WYk8T9oTAdmQ?= =?utf-8?q?ZvWpdRSwk3083SgS9GI8HS9+SY3zzZezbfrGphdZBGUrvEQ7COOBOWOi4kYoV59wk?= =?utf-8?q?wV3W66c/chdJ/C9CFw+rdtvIjdrPN14RM65Of6WqD5JgG89rqJHKDq61fudkFxVA2?= =?utf-8?q?de3W3fuZQBgW1eAeNAiD27Xn/D2W0R4K5/TJFfvjsOmyzIpWL2eVibDY03SMuswwS?= =?utf-8?q?4b0A5BykKshn49WNPcyb84XWld/pP452B676WRK94GzdPscHhtBfZ8ZWmM4SjoXHM?= =?utf-8?q?OFhPRf6SqwrF70J32VHyUc+npXjdqJfeUrNDiOz/4ztBbwFoGcicud+gc/dPJU7Cd?= =?utf-8?q?PlARCJA9k9LhF5IHvFWCaCV7KpiGytXtDm9q7atJJLnHl0WEPAMl1rKsuxnfJpKjA?= =?utf-8?q?o2kV2Pm2vwBHfmaQ5AFA23ZV3Swg4yInn2hm7k59GK8ajCKZ+avkSalA5fkn0H880?= =?utf-8?q?bs7vQ5EurGufCMT0OIhFu7rbZfpackYI6hi7VMfH+PblIRZy1KGLYDFmP/LLYzyk7?= =?utf-8?q?uzbuqHr/bCsbIFDG+4Bmf5UUdWFs+4pwI4OEvBlErBlu3VgXNZ+ZlLrPcTGyY8F61?= =?utf-8?q?S3lRIzDSm8YHtfXnBH0BQK40infcTW4S49WPk99/Wmp+ILcVHI5WiSyscMWEr0kzL?= =?utf-8?q?OsgJL1hGJKMh4E6UPzuEqKIVHbXLhy0IL3aNYbNg3BgOqSQM9uoep/R9CDZPddaJf?= =?utf-8?q?xJsiBPL44yyOE+KrDvQYzCKILRoZsIMrdO3acslQYpEl09JhiBKyKEh4FotT+MyVo?= =?utf-8?q?ix/D5TjwEO5PsOT2hETdVFt8pECbXb9jJrTky+Zx960BN1LdkxvYMfIhAWPD/OVgF?= =?utf-8?q?j+yyw87QX/vlbMwbYSwbbkhT/yDQaaOOGqk2PLc0mGQh6Tto1UHbrl8TTEa81FMNf?= =?utf-8?q?VZBOq+3Zqk3L6J3o7FSHAi4XLkzmuFi5MiSwltg=3D=3D?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-42ed3.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a027e547-735e-4cc4-5401-08db0b18bba4 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2023 03:41:45.7817 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MAZPR01MB5554 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Greetings from t2linux! 2 years ago an attempt was made to send the driver for the Touch Bar on MacBook Pros by Ronald Tschalär [1]. Due to some issues pointed out by the maintainers upstream, unfortunately it didn't make it upstream. Now we at t2linux [2] have addressed those issues in this patchset and also improved the touchbar driver for the T2 Macs. We also have added a new driver for keyboard backlight support on T2 MacBooks with Magic Keyboard. The first 2 patches of this patchset are the ones sent by Ronald before, with the issues addressed as pointed out in [1]. The third patch introduces a new driver, apple-magic-backlight, which adds support for keyboard backlight on T2 MacBooks with the Magic Keyboard. Note: Apart from these drivers, for the T2 Macs, an additional driver shall be required to communicate with the T2 Security Chip, as the Touch Bar, the internal keyboard, trackpad, camera, ambient light sensor, headphone controls, and NCM Ethernet are accessed through a USB VHCI created with DMA channels to the "T2 Bridge Controller" 106b:1801 PCI device. A work in progress linux driver called apple-bce [3], or USB device passthrough to a Linux VM guest on a Windows host with Apple Bootcamp drivers can be used to get Linux these USB devices working and test these patches. [1] https://lore.kernel.org/lkml/20210228012643.69944-1-ronald@innovation.ch/ [2] https://t2linux.org/ [3] https://github.com/t2linux/apple-bce-drv Orlando Chamberlain (1): HID: apple-magic-backlight: Add driver for keyboard backlight on internal Magic Keyboards Ronald Tschalär (2): HID: apple-ibridge: Add Apple iBridge HID driver for T1 chip HID: apple-touchbar: Add driver for the Touch Bar on MacBook Pros MAINTAINERS | 6 + drivers/hid/Kconfig | 39 + drivers/hid/Makefile | 3 + drivers/hid/apple-ibridge.c | 610 +++++++++++ drivers/hid/apple-ibridge.h | 15 + drivers/hid/apple-magic-backlight.c | 143 +++ drivers/hid/apple-touchbar.c | 1500 +++++++++++++++++++++++++++ drivers/hid/hid-ids.h | 1 + drivers/hid/hid-quirks.c | 5 + 9 files changed, 2322 insertions(+) create mode 100644 drivers/hid/apple-ibridge.c create mode 100644 drivers/hid/apple-ibridge.h create mode 100644 drivers/hid/apple-magic-backlight.c create mode 100644 drivers/hid/apple-touchbar.c