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 8798DC636CD for ; Fri, 10 Feb 2023 03:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjBJDos (ORCPT ); Thu, 9 Feb 2023 22:44:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbjBJDop (ORCPT ); Thu, 9 Feb 2023 22:44:45 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2080.outbound.protection.outlook.com [40.92.23.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8368074311; Thu, 9 Feb 2023 19:44:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i9FpmwJ1xQQcP+waZPZT9DVYFqtru+MGDSAvk1XlvaoR4Y0Bd+yDHPTNt1AZkcAXYxMJyP1AynNSZhP3U5jXhT+5wuGQAxMEiNeKUeWdjPqOiLVOoumYxBNsyANxOBKSHHQj4SiEki0lEBk4L5Lype3I6pJHf7suv2BEnmeW/SrTJ8BDAEzRfI+SzlhbF6Sdtlaz6aRe8fLADJZedmfTr+iGb0cwCqkjGF9eNJydq4+dORNl2AfVYpahaR/c0WZBF4Ch80osvin16poA3yKvOCYAtaqTxSKnTjHzH9l1wL+8ptv0Tq0X3us8T7zmV9LrvU81z1ypCpp6jwSGc013qw== 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=HpVyLms6/HzgQmXROEJbE/HvIMbEFWoSNJ1DDcly0oE=; b=do0nunavctCP4Mk7Ivgpp9yzeAE0lXkuWL0uZM7UDIf+j6FP8q2gKNWeLuonzDj0SwhO4sC6/8+XmsVP8/zHEZcSouegTEbDCNIfiJJ7U0wnoKL8Dr2JjWy8DjzU3K80fxSPMcA2oq7V/RB97jBK23eLZllcSCj6JGtTqeQ6PS3eT3u/Ux3xwKcV1gRa5uVV3KiIsKzJ71wYQmCcbNqicvfD/DKc5CIMi01NJB9N64TF0soJmVfH24mpDn4bizfV+YNOP/90n36VHZAIKsGZW4wRuXIubpPlOGUSUQA6slQxjb+rrJK06CNDeIm5rBB6TTvBwzoHYDvF2O/pzLii+g== 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=HpVyLms6/HzgQmXROEJbE/HvIMbEFWoSNJ1DDcly0oE=; b=PoxazQSe5Ra+yzh0M54LpupLhvAvf7UaG4pBor6svSMCXE4tn80PigyHgZ3vlh34pRRl4LFfUFsDw63C0S+62hmJeWZcPeFas9lm6MTEPgShbCcnZ7cYcczLCHrS8xoqMcDrXZ+6Yn1E7JiSdWKn81PyXyZ1mUJB4DAyH4b1t5chANyGkU+XjtRY/3LEB/sprLGnGKKbGFKT6X7pbhsABJy4Zr4syBbMtuskeqYR2gfBq4CfO/MkDKJme/iMdnYKD6pYnjCi0QXUWSsZLgFlavrclT08qPjxLhXJfl2Y20gRQKTdrdEzpqycbG+u+Jbbzty5PQTRkDAupXpuBgCrzw== 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:44:26 +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:44:26 +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 2/3] HID: apple-touchbar: Add driver for the Touch Bar on MacBook Pros Thread-Topic: [PATCH 2/3] HID: apple-touchbar: Add driver for the Touch Bar on MacBook Pros Thread-Index: AQHZPQH444pcUE9Pn0ybBKOwkJjnOQ== Date: Fri, 10 Feb 2023 03:44:26 +0000 Message-ID: <868AA58D-2399-4E4A-A6C6-73F88DB13992@live.com> References: <40274C3D-4F4F-479C-944C-EEBDC78F959C@live.com> In-Reply-To: <40274C3D-4F4F-479C-944C-EEBDC78F959C@live.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [H1dRgnGmS0FAf3TqD/55ScCs8Ckto2D4] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BM1PR01MB0931:EE_|MAZPR01MB5554:EE_ x-ms-office365-filtering-correlation-id: 5bea2c93-d060-4217-aece-08db0b191b5a x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iYHLjxKb9zcvbyJH2yVGuN9IpSblVP7yYPvaPg2QjJ4YfROmMzCcNeIFTHjSHt/I9W/40sZ/ey9N0+tRYcCV5ItPweiYEbLcy4t2kSQ85ix3V02fO44bbj+LTq3kRZvOd65m7dkDHWUwuk0pRRoJ/+1JTqxCE0QhHxDrW5ZBxtw9N6PCLabdR88hdGTiFZGd6an4K9530o5KFrtbCyWoMj0mjZIIPLWuX/l2hPSe7wY85IfnIWofeAhOa2HGxF+9b5JpC1N2osxQfvzT5I+0xzLA00rSKFI0oqLGApwTo5B/vAM/of+EHQAbzHJx0HE4Kdpttp9oZ4LPAXLT0Ta1Zepc6esQ2MuijMoI91M5lFsAtulf24+mJ995GnimqVgX9N5aJpDiSgoaHnwyrnSq4id9xX9tV5ezgn3WCp2T3zlA0TydjKN60q3N0iroblbJIrSiKxAhcERCfEAKd3p+H4vyGcqzoqYa66RUfpfdpWm6rUdGtL5pH1b5MtOTKyIZnIi0BSuRASbZjqctixooTVlE4qjaVmrI4BU0cRb0CAy+gExrO/KxoLv0z6soaumMLaUBjFx5gtsULq81GF5sUBiMt41jlcuBkA3Gm1846EM= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?Vm1FcGNCczIvaTdVZ3lVek5MUTlYS0hEMk10QWJyd25KakpkVnFaUWQ2YUU2?= =?utf-8?B?L1FHclhramJKazhuaURQYnhOd2tpL1gwYnZ1RTl5a1VDTjVzYXduejFkL3ZD?= =?utf-8?B?RkNOdTZnSWJsYTQ0VXVEeGNycTZFbXphRWM3ZGZ0ZHpRR3lIRnovb1p3ZE5U?= =?utf-8?B?YnFRTkc4Mk5La3NXeGtDQkdLT0d1K2I3TFI3clRnc0o2SUpUK1NKWG9TRko5?= =?utf-8?B?dXhrV1RBczZlVmhGRUZhK1J5UFNIMVhndmxKRithZlZsaWRQZERja2ZZa0hn?= =?utf-8?B?RGIrK28wOGZBVzhOZWxBa1NXU1NuYlRhVXV2aEdrb2pDNE0zMHphSWZGbnp5?= =?utf-8?B?bUZ0ZEtNUWt5M0FuS1FnUXB1UTBnWlhIelc5aDUyempVUFFYME1KVmxNMm9O?= =?utf-8?B?cXptQ2Z5NE5HanYzSXE3cjg3OGNqZDhGV1ZTWVlWOUliVHViRVNDNFY1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8zZVI5UXdxQk9sMDVJNXZQ?= =?utf-8?B?WUREaFp2VFdPelhCYlB5ZHFPekNBcmlQcHJHeHVJS2RJdnhmKzNFMEFSZ3E3?= =?utf-8?B?ak9zNWFsdlJiN2pFWnllcEo2aUJFM0hraDBPVDdtUHpQTzlaNFI5Ly9kODR0?= =?utf-8?B?ajgvSVhjTkpzWWFJYi84cTlmbllMN2pLd3lUZEhlY3ZvVk9aNjBaMkphN0hS?= =?utf-8?B?azhVYWRuY1M1dWZiQUsySG8rZXRGbWM1NzNKTW5MR2hiSkZ1VVU1eDU0d2NE?= =?utf-8?B?elJOaDJQc2dzakY4cXgrM2FBZXkwa2Voc2JYSmd5Q3IxTHpyZUJXV1VJNDRW?= =?utf-8?B?dWdCN1hBVWpxVThUenowb05TWEE5bUJwa1ZhbWdWeW43Y214ekdtaW5nPT0=?= Content-Type: text/plain; charset="utf-8" Content-ID: <30A691B92BE79F4F91459B2DFBF374FC@INDPRD01.PROD.OUTLOOK.COM> Content-Transfer-Encoding: base64 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: 5bea2c93-d060-4217-aece-08db0b191b5a X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2023 03:44:26.3760 (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-kernel@vger.kernel.org RnJvbTogU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