From patchwork Sun Aug 21 08:04:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 12949867 X-Patchwork-Delegate: jikos@jikos.cz 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 6A4D9C00140 for ; Sun, 21 Aug 2022 08:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229532AbiHUIE4 (ORCPT ); Sun, 21 Aug 2022 04:04:56 -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/2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M0uQ0u+KqCBUE0JAj5LpC/3EG33etCDxvO7K0p2VyeJKKheRIQCn1+Zh0AEOmmCpzB0i5DQj4RLn4ca8jhtQVy9VyiXKmU7dn+3E12YRtE59wW1Bo0EH8F179Zmpo1YqrT6dG4K/CAUrnngufDVUMioQOIUqlBT154SC7gUT8hsJ59cTwKSS3SWlTnjOfpnNaqjBTx37DPG5FpyK67q5s85A10oHNEAxjgGLcCVTjovFPZo6Ey+2aKXkr7/eQamiyd8D5O4xh0Vo1SnvigDULYDrVbk9e5IKYdGroMb7/HTOAZiR0xS+xnpyGs7US75ML4r5dWwEp0NvLhUfWsz1jx17SUOHcS5g0Wo6JTZLUAOIbtBkbo3HY9g0YE+Z+aL9Z+yUvZqm7jdjiYKXd6dKv92EirLISPlsClWrV1dvlgZPnrDsidYZdQrrs+7YE5UG3OPatY6crZL9YIy+w8CgkfmyVfYlRgHkxI5tUouC9Mb8rVrOOiFDXiOd5Bz0KhIpNZG6ONU6M732YbNfCM7LF17I2AT42zHV28+jRxJIBmoVf4bJhXG6ZsxNb5LgALjGvuqI+rI7BMtPmeUHD4feVzFfknnMMFSUVbSAxG65ipZjgiRlOtdBuihoNeUmCi3RWjKh6I+zsqaKRwp/X14HiWX4I5NXNN9215re82UjmUeENmsTN2D7v5eleN7xlgkqskYg1Yhb8PmHfu233a5Ar5CWgitVYOZ9jpgENAfQYkJ8LUWZJOg== 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: 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@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 [Apple 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 Device [Apple Inc. Touch Bar Backlight] on usb-bce-vhci-7/input0 [ 12.211824] apple-ib-touchbar 0003:05AC:8102.0009: : USB HID v1.01 Device [Apple Inc. Touch Bar Backlight] on usb-bce-vhci-7/input1 [ 14.219759] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110) [ 24.395670] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110) [ 34.635791] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110) [ 269.579233] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch 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 #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_driver[] = { { 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_BACKLIGHT) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) }, #endif #if IS_ENABLED(CONFIG_HID_APPLEIR) { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },