From patchwork Thu Feb 3 12:22:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 540211 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 18A87C433EF for ; Thu, 3 Feb 2022 12:22:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350499AbiBCMWQ (ORCPT ); Thu, 3 Feb 2022 07:22:16 -0500 Received: from mail-bmxind01olkn2020.outbound.protection.outlook.com ([40.92.103.20]:36098 "EHLO IND01-BMX-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238772AbiBCMWO (ORCPT ); Thu, 3 Feb 2022 07:22:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c777byYqlohGQCCY9D2bkZPUshNZaWbnRjC8G16gXo8DWXfyQe5eSKijGhp0h2lnNsdHmqrmgIt9HBGZAJtitWXTYj/egCC+21mpR+dCLLkA1jGCqTHyRkCkB3lk0AH/NYsKNL4Kwbkb5VDYdrhUtiVwPE+MaJdmEzugSXwoMvf6bLMbLWXZOYaTF3eDHcyN+jD9om7pihg7aeAsyvHpZVX8IzSpmKoWn/Vi1vw6+MUjRq03Edac/0SU2y7c+ouq7tLihJL9qCYrICTVAblKRES0sYpL/22QMNKM0jZGRDLCTDPcL8GQZ2iB5BLAvlWE4P9KjUjcCNEZXttdEyjROQ== 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=3ynjlUzo6Cjav7qfolIYsnNjiLNNvNMTJYB0yphqWXk=; b=ch+a8pQ0FMuLwyAWv19msoWgCWuncgn//BUJQjIaNDddrz7+Ip/tnM7up0OJL9TbBYn6+/8txqF5mDY9+p05+QZeF8FG0TZ42CY9LbB9CnrMpA8EiTmzTKqBYO/Ibb0au2aDcGEjfUbvh7Q1RrY+DDKZM9errGCi+LiXAeD0GLTHsV1s6QlJ5rq5Fm9CocGib1FMSUsMWAVrZIWV9drmEUT70+tjH2AqIE11m78XNE0WLJ7jGjzBlnBFPmhpVrPuXaoe7cIdEQNDNE56nwrB2d7Egr9seYNfblbMFsCShGGoGFM2lm4wrwgutTh7+A819Xmj+wH6z34yG7OiWZFGOg== 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=3ynjlUzo6Cjav7qfolIYsnNjiLNNvNMTJYB0yphqWXk=; b=WqVJl7Ods14oq9Hq8HtJF349nCI18HJbaxD3KMu7//rpZfCnMsjJhSn8e3XDwx+vxUikTRXXkjum73CH5WiBGcX36jHEhzFp54pUz2bUm2aExsc8aiBkaB31KI8oTmBmi8/aUNF+bd2AcbglOSm/1c711Zm6oOStfol+OHBqHk/lYml35hfm+i3sqCoG0QiiZVHXXAeNy3NqSzbFB7QsG3pRSgp8ddtR2tCI9OAS+FXRohhsCq7WLCvwmf8S9w3LvXRnoS6l+awaGuT7AQIp9Ued+j26nEl/SVE5gXFXlvsORrwlhoBfqpCPH6sThsxx3wbkkrEKJC0lxvvUAL1wRw== Received: from PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:1b::13) by PN3PR01MB6934.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:a9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Thu, 3 Feb 2022 12:22:09 +0000 Received: from PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM ([fe80::d19b:7cd1:3760:b055]) by PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM ([fe80::d19b:7cd1:3760:b055%9]) with mapi id 15.20.4951.012; Thu, 3 Feb 2022 12:22:09 +0000 From: Aditya Garg To: "jkosina@suse.cz" , Jiri Kosina , "alexhenrie24@gmail.com" , "benjamin.tissoires@redhat.com" , "linux-input@vger.kernel.org" , Linux Kernel Mailing List CC: "paul@mrarm.io" , Aun-Ali Zaidi , Orlando Chamberlain Subject: [PATCH v3 2/3] HID: apple: Add necessary IDs and configuration for T2 Macs. Thread-Topic: [PATCH v3 2/3] HID: apple: Add necessary IDs and configuration for T2 Macs. Thread-Index: AQHYGPiqg2IJkgvOJ0+WrzX+lSIq1Q== Date: Thu, 3 Feb 2022 12:22:09 +0000 Message-ID: <9981348D-0D48-4613-A46E-03E9A1897E59@live.com> References: <67E7EA8B-CF21-4794-B7B4-96873EE70EF6@live.com> <1088ECFE-B356-4731-AC8A-09A4421DD7D1@live.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [lplVlAXoVd0ph1gcJqS8z7VrKMkfFF/H7qgHpw9DPtpRPINyB1qK9l5OVn53k46U] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 089af0f4-0157-42df-abf0-08d9e70fccf8 x-ms-traffictypediagnostic: PN3PR01MB6934:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2jcfK4A9aerpPldO9dwq+uJPJVVg8ZGyKM4hlW9vUniqhtEo2T3PU4q7tPugQAO2r1o83yvSyy5JweHfSwtyShHdzJFunRmihTYwJFiDbSTia14ztyfLLz2iF0JkcGM8vf8mrP/C3pddFAxVZijUobemMb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uZVhvYtuf5q/0aP7c5/k86B2DfnSKVP0U+1MFZj8P8EK1THLLNs0LyU0ZrRiNyCDSC67etlFS9IpiAYUoeSGb3cNu8kJnUi98iJyGZ2iNu4Nj5G4If4I5XxxdjXsK6hG8dsTBaOaM9BCmOg/UVWQlLAyFnhwMdKoIWEaS79qj82gaZ65KRyR94RUT/z8GMRgQRQzOOi3pyq5BaMpDKtSQqxWN9PITywY9bYMmoQ+gejoU/NxZrOQ/ZVje5ZWW6nHi2mRcRj5R23GK72UBcTDibHzQK0NKNvcB/58mvDHM92lzKiDHPHnVyKXTyW3s5KQPvXIsjW5bBIaA6hxlJ843f0JifM0CTK5iffYjy27xtjTuOVsBRzgj4JcxnLS5/xr01FpFQxVqX77aoRWtZKA5nWgF7LOZhyQyc1VtPuUnySXJqKSKzawiVsem7UZKgLpmYzDpyNyhed7srcvFOYw2T2qlqvYCQ== 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: 089af0f4-0157-42df-abf0-08d9e70fccf8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2022 12:22:09.8541 (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: PN3PR01MB6934 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Aun-Ali Zaidi This patch adds the necessary IDs and configuration for Macs with the T2 Security chip. Signed-off-by: Aun-Ali Zaidi Signed-off-by: Aditya Garg --- v2 :- Use better approach to map fn keys v3 :- Use BIT(10) for APPLE_BACKLIGHT_CTL since 0x0200 (BIT (9)) has been used. drivers/hid/hid-apple.c | 16 ++++++++++++++++ drivers/hid/hid-ids.h | 8 ++++++++ drivers/hid/hid-quirks.c | 16 ++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index c22d445a9..823021c24 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -861,6 +861,22 @@ static const struct hid_device_id apple_devices[] = { .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K), + .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132), + .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680), + .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213), + .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F), + .driver_data = APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 26cee452e..8ad26c20f 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -167,6 +167,14 @@ #define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272 #define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273 #define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274 +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K 0x027a +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132 0x027b +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680 0x027c +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213 0x027d +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K 0x027e +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223 0x027f +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K 0x0280 +#define USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F 0x0340 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b #define USB_DEVICE_ID_APPLE_IRCONTROL 0x8240 diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index 9af1dc8ae..963cf2a2e 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -294,6 +294,14 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, @@ -929,6 +937,14 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J140K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J132) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J680) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J213) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J214K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J223) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J230K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRINGT2_J152F) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { }