Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1116421rwa; Sun, 21 Aug 2022 01:07:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR71QittZBtChgkIR5vadFSAot2G/m7HvbNoKno2j1SkLOjOoQ1YSKdCk9qyuvzXqXX4Jbb6 X-Received: by 2002:a50:fd83:0:b0:446:665f:f500 with SMTP id o3-20020a50fd83000000b00446665ff500mr5464915edt.407.1661069266857; Sun, 21 Aug 2022 01:07:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661069266; cv=pass; d=google.com; s=arc-20160816; b=vM6Hnw08cWi/+mVKGWUfHSPmhk7hG7xlFkidGGkbsoqVyK2rJjT8jWKSJNr6npx2Ts 1/UCUsNSkgGx4iteKi25FK3VdTkGY4tthgeU8uidEgcLwK3F6Jx+bm9LyyBDyxkEJj2s Segvd+c5vi5/sAsO9nOXrB502eV+cYcBl1TnxwIz9OHYolYzBfZOU7Ri096RBSeiMPBv qbnOyoMHVv4BfMYKufp1ShJzoL01br49AqCkjnV4NhjyzF48352XoyVwemFzp+yWjTlv SksYcZxzS8aS1Ly1l+QFrI7paFNFIT2Axf50htuezUgwYFMlhFD1VPr37p+SPd1ArJ1q vX0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=V45qjMYj3h9KxIOG0T+8wSKEzObPX5v4mVeIRKWyZss=; b=sNyr4mXNze1u7KaSHA9ESV3kXS1tHJa2gKOLdhQcp2Kh3Loo1Fk/X5ZoYeLKXgygRL w/Srol4coT8GqF06nh7FlA/s2WsjoyGNOwzOtS7vZHzsx64/qMnOAb7Dc3HjALJOsl15 MGp6Vq6z6HeBZNufef9I1pXJquRV4DQR8qL7Pl1LjwIh7d/yQBqV5DznoRXPGxNzvi4R yayDuk7Cgwm/+yrF71/rUi4sP/cl334eCU9rL1ZnkqLJzzN5TXiHn6MVC3pzDKMl4X/e sauFjGQpxmj4nH6MKhCz04laqAuRtSEU0KQienRCSD2NfqqWoh+byCYnTx0v30OPkWG/ Llzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@live.com header.s=selector1 header.b=qVKdleNS; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=live.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt37-20020a1709072da500b007308ab90efbsi8123456ejc.776.2022.08.21.01.07.21; Sun, 21 Aug 2022 01:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@live.com header.s=selector1 header.b=qVKdleNS; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=live.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiHUIE6 (ORCPT + 99 others); Sun, 21 Aug 2022 04:04:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiHUIEw (ORCPT ); Sun, 21 Aug 2022 04:04:52 -0400 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2043.outbound.protection.outlook.com [40.92.103.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1198C19297; Sun, 21 Aug 2022 01:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z9wmJoQ5Dk058G9i4LCUwj7NxytyODkBXKBl2tt+jzJTafJtQYfTddXBHzzYO4fo5TxkmUEewbnbCQMdwg4QkmcOUhz8dmfEpcuDXN3P0vKii1fUxFr1XNKzqgJjxiIHkkJYa4cqzqZWWItGgWEDYsjR0RJuU1bgZbbAbhMOysR/ZOaFTtELe1WgsMQD1vKnPqGpNMNgzq9CR43tnPdVn1kJ9udAc1Jos4niFjRlhpdGQVcHf53FzDNTmIF7yxFVaRBhi5MvzIvxgY703P2EMVV8DWlbMh/nDC08dykuSpHzQ9uupCzy4Xlyo1FPIeRXy8AGEzCqGPZk/aM14M4AYw== 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=V45qjMYj3h9KxIOG0T+8wSKEzObPX5v4mVeIRKWyZss=; b=gY9aRZdDuo0ch2IDeiWY5CyvA/n+xGDgdggtzy6Oj4ULZET6TRN88pRatrc9s5aMvlxkw5RgZMy4iKRhrX0qgVNXFMtFyUwWiAX2Hve19AiTJu8EDoATGM6MTt0QI9GISZlGYc2JbgwMWOV/vOMrt7CXZX/yUABKvdit3zZsW2GmPGtb8rd3HIHdiuSBM+kkwzQHYkt1A/UqpDqVP0AdoDUdym3b/EfifhKYQ9PPlTUK1Y8XCKveNxUJ1CkMXCKqnaWgFieRUO3/6QVmY9AHPax4qTbzd4tFFmfj6XeGOOq7YkBOatRc3KFfljhpnVSEupNvZw94mZNNb1zZWpl04g== 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=V45qjMYj3h9KxIOG0T+8wSKEzObPX5v4mVeIRKWyZss=; b=qVKdleNSdhfB/xNITGQ0t4OZfzMclSuWE3vkK1+rATvP+YDAxYu53uwEtYHHAM7MY2Cjpdrk0WTcChCIpQcOpvrF9AC6pXiOAjfUhFej0iN46pHW9cbmzNaj0PMUcfi05QmE1dsFu8aas68qHohAQshmANmbFZllmrHQI9bKluYTre4ONMDr3rl5SShjfxdEfzAibOrsnS0ykQl2GN7c2vQnWGpx4Xi/UA8CK6qPORpJnCxUxZR75LsMdzFtliKAo831T2zZ7q/HaAOlAoqWFhcxc+JcPcwdNWQQyFgSuinS3HrG/Yv5hgKxCnpRo54SLQMoukLKSqTQDfZZ/8QogA== Received: from PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:1b::13) by BM1PR01MB2947.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:46::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.19; Sun, 21 Aug 2022 08:04:45 +0000 Received: from PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM ([fe80::cc2c:fa62:8825:6b97]) by PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM ([fe80::cc2c:fa62:8825:6b97%6]) with mapi id 15.20.5546.021; Sun, 21 Aug 2022 08:04:45 +0000 From: Aditya Garg To: Jiri Kosina , "jkosina@suse.cz" , "benjamin.tissoires@redhat.com" , "linux-kernel@vger.kernel.org" , "linux-input@vger.kernel.org" CC: Orlando Chamberlain Subject: [PATCH] HID: Add Apple Touchbar on T2 Macs in hid_have_special_driver list Thread-Topic: [PATCH] HID: Add Apple Touchbar on T2 Macs in hid_have_special_driver list Thread-Index: AQHYtTStFWCRoLFmPEqV8QD4Wsg3WA== Date: Sun, 21 Aug 2022 08:04:45 +0000 Message-ID: <30CA04A0-4F49-400F-A684-2C65B15E4431@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: [5pNxUAJkx8s9mdIWHMN+iG7SGSb+t07P] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cc3568aa-d967-4731-b164-08da834bcf93 x-ms-traffictypediagnostic: BM1PR01MB2947:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2iLqCw7l8/dAsB9xpoctiB51x7iAT+R6vpgCy6kZ8QZVdhGZ7AmQ+ERQuBt8PgUuDxPHVHlUkGIEL8cTJFvv32tTpsU9YfmnuWi9UnUIorjd/nRxmJeV69Xo1Utmme3m7zaKxVn22DeNV9muAs/wmiS/JA/2KATPeU+GGiGy9LSGHBKAILPO99iY9M7q/tv6CA4Vr+NQh51H+v0NaE6vOXnghaWI8lnNkfX+qwODb0CUuNIxN6HSJjrP7HINUfLN2D66tpoqs81YttfZB7798tgER72/9Rt9gmm4KdORm7Yt9yvJmuKGUuJN9IhUE3nz4AAfFlr7a8OgOf51ppKorIYGKbgXFuxHIKeEC6DZxMhPfeyx3CrmoAMl/7e8yYOPI/bAoneJf4C33t6DS8/m5VJ785hw0EFcRn3CdiR2IOKXabqK/m/OE8IZcUpJfVxXG4KD88Mj6iXzjJ8nVEU3RGIcO6LXi0+LqeDAzeqMrDOUHb/HGNujDNg15+gCyzkuRFu3k0z0HaxOGffxFMTpH3H89diydnqlV+bgxPCradMBbpKgtifQBa5j+5dcZC4vYNCdAn0NbzvVorS4TzWY7CEQujHPYI8KgbY6A0rd3k6ZpjpRe4+06vEfxBqTGAYK x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wnMUyXb70hkANHR/odiJoktJX4YL8iPxlEB4kshbxocCOQEhhH2XDLdy0qCU?= =?us-ascii?Q?CQk2BXgl9U2sLRC2LAaeHxggKyd73yPYq9MeMfxb5JLXqJRq+rSL1V6R/fQi?=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rrs+7YE5UG3OPatY6crZL9YIy+w8CgkfmyV?= =?us-ascii?Q?fYlRgHkxI5tUouC9Mb8rVrOOiFDXiOd5Bz0KhIpNZG6ONU6M732YbNfCM7LF?= =?us-ascii?Q?17I2AT42zHV28+jRxJIBmoVf4bJhXG6ZsxNb5LgALjGvuqI+rI7BMtPmeUHD?= =?us-ascii?Q?4feVzFfknnMMFSUVbSAxG65ipZjgiRlOtdBuihoNeUmCi3RWjKh6I+zsqaKR?= =?us-ascii?Q?wp/X14HiWX4I5NXNN9215re82UjmUeENmsTN2D7v5eleN7xlgkqskYg1Yhb8?= =?us-ascii?Q?PmHfu233a5Ar5CWgitVYOZ9jpgENAfQYkJ8LUWZJOg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable 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: PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: cc3568aa-d967-4731-b164-08da834bcf93 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2022 08:04:45.4070 (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: BM1PR01MB2947 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aditya Garg The touchbar on Apple T2 Macs has 2 modes, one that shows the function keys and other that shows the media controls. The user can use the fn key on his keyboard to switch between the 2 modes. On Linux, if people were using an external keyboard or mouse, the touchbar failed to change modes on pressing the fn key with the following in dmesg :- [ 10.661445] apple-ib-als 0003:05AC:8262.0001: : USB HID v1.01 Device [Ap= ple Inc. Ambient Light Sensor] on usb-bce-vhci-3/input0 [ 11.830992] apple-ib-touchbar 0003:05AC:8302.0007: input: USB HID v1.01 = Keyboard [Apple Inc. Touch Bar Display] on usb-bce-vhci-6/input0 [ 12.139407] apple-ib-touchbar 0003:05AC:8102.0008: : USB HID v1.01 Devic= e [Apple Inc. Touch Bar Backlight] on usb-bce-vhci-7/input0 [ 12.211824] apple-ib-touchbar 0003:05AC:8102.0009: : USB HID v1.01 Devic= e [Apple Inc. Touch Bar Backlight] on usb-bce-vhci-7/input1 [ 14.219759] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set tou= ch bar mode to 2 (-110) [ 24.395670] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set tou= ch bar mode to 2 (-110) [ 34.635791] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set tou= ch bar mode to 2 (-110) [ 269.579233] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set tou= ch bar mode to 1 (-110) Add the USB IDs of the touchbar found in T2 Macs to HID have special driver list to fix the issue. Signed-off-by: Aditya Garg --- drivers/hid/hid-ids.h | 2 ++ drivers/hid/hid-quirks.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 0fb720a96..78cd2a62b 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -185,6 +185,8 @@ #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f +#define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102 +#define USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY 0x8302 =20 #define USB_VENDOR_ID_ASUS 0x0486 #define USB_DEVICE_ID_ASUS_T91MT 0x0185 diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index dc67717d2..70f602c64 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -314,6 +314,8 @@ static const struct hid_device_id hid_have_special_driv= er[] =3D { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY= ) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_= 2021) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_= FINGERPRINT_2021) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLI= GHT) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLA= Y) }, #endif #if IS_ENABLED(CONFIG_HID_APPLEIR) { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) }, --=20 2.34.1