]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2024 03:36:18 +0000 (19:36 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2024 03:36:18 +0000 (19:36 -0800)
added patches:
hid-apple-add-2021-magic-keyboard-fn-key-mapping.patch
hid-apple-add-support-for-the-2021-magic-keyboard.patch

queue-5.15/hid-apple-add-2021-magic-keyboard-fn-key-mapping.patch [new file with mode: 0644]
queue-5.15/hid-apple-add-support-for-the-2021-magic-keyboard.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/hid-apple-add-2021-magic-keyboard-fn-key-mapping.patch b/queue-5.15/hid-apple-add-2021-magic-keyboard-fn-key-mapping.patch
new file mode 100644 (file)
index 0000000..43a705a
--- /dev/null
@@ -0,0 +1,72 @@
+From 531cb56972f2773c941499fcfb639cd5128dfb27 Mon Sep 17 00:00:00 2001
+From: Benjamin Berg <bberg@redhat.com>
+Date: Mon, 8 Nov 2021 13:50:38 +0100
+Subject: HID: apple: Add 2021 magic keyboard FN key mapping
+
+From: Benjamin Berg <bberg@redhat.com>
+
+commit 531cb56972f2773c941499fcfb639cd5128dfb27 upstream.
+
+The new 2021 apple models have a different FN key assignment. Add a new
+translation table and use that for the 2021 magic keyboard.
+
+Signed-off-by: Benjamin Berg <bberg@redhat.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Aseda Aboagye <aaboagye@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/hid-apple.c |   29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -70,6 +70,28 @@ struct apple_key_translation {
+       u8 flags;
+ };
++static const struct apple_key_translation apple2021_fn_keys[] = {
++      { KEY_BACKSPACE, KEY_DELETE },
++      { KEY_ENTER,    KEY_INSERT },
++      { KEY_F1,       KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
++      { KEY_F2,       KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
++      { KEY_F3,       KEY_SCALE,          APPLE_FLAG_FKEY },
++      { KEY_F4,       KEY_SEARCH,         APPLE_FLAG_FKEY },
++      { KEY_F5,       KEY_MICMUTE,        APPLE_FLAG_FKEY },
++      { KEY_F6,       KEY_SLEEP,          APPLE_FLAG_FKEY },
++      { KEY_F7,       KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
++      { KEY_F8,       KEY_PLAYPAUSE,      APPLE_FLAG_FKEY },
++      { KEY_F9,       KEY_NEXTSONG,       APPLE_FLAG_FKEY },
++      { KEY_F10,      KEY_MUTE,           APPLE_FLAG_FKEY },
++      { KEY_F11,      KEY_VOLUMEDOWN,     APPLE_FLAG_FKEY },
++      { KEY_F12,      KEY_VOLUMEUP,       APPLE_FLAG_FKEY },
++      { KEY_UP,       KEY_PAGEUP },
++      { KEY_DOWN,     KEY_PAGEDOWN },
++      { KEY_LEFT,     KEY_HOME },
++      { KEY_RIGHT,    KEY_END },
++      { }
++};
++
+ static const struct apple_key_translation macbookair_fn_keys[] = {
+       { KEY_BACKSPACE, KEY_DELETE },
+       { KEY_ENTER,    KEY_INSERT },
+@@ -214,7 +236,9 @@ static int hidinput_apple_event(struct h
+       }
+       if (fnmode) {
+-              if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
++              if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021)
++                      table = apple2021_fn_keys;
++              else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
+                               hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
+                       table = macbookair_fn_keys;
+               else if (hid->product < 0x21d || hid->product >= 0x300)
+@@ -377,6 +401,9 @@ static void apple_setup_input(struct inp
+       for (trans = apple_iso_keyboard; trans->from; trans++)
+               set_bit(trans->to, input->keybit);
++      for (trans = apple2021_fn_keys; trans->from; trans++)
++              set_bit(trans->to, input->keybit);
++
+       if (swap_fn_leftctrl) {
+               for (trans = swapped_fn_leftctrl_keys; trans->from; trans++)
+                       set_bit(trans->to, input->keybit);
diff --git a/queue-5.15/hid-apple-add-support-for-the-2021-magic-keyboard.patch b/queue-5.15/hid-apple-add-support-for-the-2021-magic-keyboard.patch
new file mode 100644 (file)
index 0000000..7dc0349
--- /dev/null
@@ -0,0 +1,52 @@
+From 0cd3be51733febb4f8acb92bcf55b75fe824dd05 Mon Sep 17 00:00:00 2001
+From: Alex Henrie <alexhenrie24@gmail.com>
+Date: Fri, 8 Oct 2021 01:37:01 -0600
+Subject: HID: apple: Add support for the 2021 Magic Keyboard
+
+From: Alex Henrie <alexhenrie24@gmail.com>
+
+commit 0cd3be51733febb4f8acb92bcf55b75fe824dd05 upstream.
+
+Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: Aseda Aboagye <aaboagye@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/hid-apple.c  |    4 ++++
+ drivers/hid/hid-ids.h    |    1 +
+ drivers/hid/hid-quirks.c |    1 +
+ 3 files changed, 6 insertions(+)
+
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -640,6 +640,10 @@ static const struct hid_device_id apple_
+               .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
+               .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
++      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
++              .driver_data = APPLE_HAS_FN },
++      { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
++              .driver_data = APPLE_HAS_FN },
+       { }
+ };
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -174,6 +174,7 @@
+ #define USB_DEVICE_ID_APPLE_IRCONTROL3        0x8241
+ #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_VENDOR_ID_ASUS            0x0486
+ #define USB_DEVICE_ID_ASUS_T91MT      0x0185
+--- a/drivers/hid/hid-quirks.c
++++ b/drivers/hid/hid-quirks.c
+@@ -309,6 +309,7 @@ static const struct hid_device_id hid_ha
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI) },
+       { 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) },
++      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) },
+ #endif
+ #if IS_ENABLED(CONFIG_HID_APPLEIR)
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
index 30a5d7fd7dca438b63c5fa1d79ad94248ded0a7a..4004d1398d5ec5213584756556ad91c24447f885 100644 (file)
@@ -295,3 +295,5 @@ net-sysfs-fix-sys-class-net-iface-path.patch
 arm64-irq-set-the-correct-node-for-shadow-call-stack.patch
 arm64-dts-qcom-sm8150-fix-usb-dp-dm-hs-phy-interrupts.patch
 gve-fix-use-after-free-vulnerability.patch
+hid-apple-add-support-for-the-2021-magic-keyboard.patch
+hid-apple-add-2021-magic-keyboard-fn-key-mapping.patch