linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Backport of 6.14-rc5 commit 2813e00dcd748cef47d2bffaa04071de93fddf00 to 6.13
@ 2025-03-04  9:30 Grigorii Sokolik
  0 siblings, 0 replies; only message in thread
From: Grigorii Sokolik @ 2025-03-04  9:30 UTC (permalink / raw)
  To: linux-input


[-- Attachment #1.1: Type: text/plain, Size: 366 bytes --]

Backporting the commit and supporting apple 0x0320 keyboard and alos
supporting new apple keyboard deviceID: 0x0321

Add Apple Magic Keyboard 2024 model (with USB-C port) device ID (0321)
to those recognized by the hid-apple driver. Keyboard is otherwise
compatible with the existing implementation for its earlier 2021 model.


-- 

Thanks!
Kind regards,
Grigorii!

[-- Attachment #1.2: Type: text/html, Size: 640 bytes --]

[-- Attachment #2: linux-patch --]
[-- Type: application/octet-stream, Size: 2733 bytes --]

diff --color -uprN linux-6.13.5-vanilla/drivers/hid/hid-apple.c linux-6.13.5/drivers/hid/hid-apple.c
--- linux-6.13.5-vanilla/drivers/hid/hid-apple.c	2025-03-04 10:04:32.252541483 +0200
+++ linux-6.13.5/drivers/hid/hid-apple.c	2025-03-04 11:15:44.449664215 +0200
@@ -474,6 +474,8 @@ static int hidinput_apple_event(struct h
 			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015)
 			table = magic_keyboard_2015_fn_keys;
 		else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 ||
+			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 ||
+			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2 ||
 			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 ||
 			 hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021)
 			table = apple2021_fn_keys;
@@ -1150,6 +1152,14 @@ static const struct hid_device_id apple_
 		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY },
 	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
 		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024),
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY },
+	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024),
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2),
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY },
+	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2),
+		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021),
 		.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY },
 	{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021),
diff --color -uprN linux-6.13.5-vanilla/drivers/hid/hid-ids.h linux-6.13.5/drivers/hid/hid-ids.h
--- linux-6.13.5-vanilla/drivers/hid/hid-ids.h	2025-03-04 10:04:32.252541483 +0200
+++ linux-6.13.5/drivers/hid/hid-ids.h	2025-03-04 11:18:52.684093836 +0200
@@ -184,6 +184,8 @@
 #define USB_DEVICE_ID_APPLE_IRCONTROL4	0x8242
 #define USB_DEVICE_ID_APPLE_IRCONTROL5	0x8243
 #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021   0x029c
+#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024      0x0320
+#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024_V2   0x0321
 #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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-04  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04  9:30 Backport of 6.14-rc5 commit 2813e00dcd748cef47d2bffaa04071de93fddf00 to 6.13 Grigorii Sokolik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).