summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Myandin2022-06-22 22:01:25 +0300
committerEvgeny Myandin2022-06-22 22:01:25 +0300
commitdb638792a9b6cb325003d33eeac478b02c595aab (patch)
tree9fb9c3b2e75b6384e0081c2c1b67e3bd3a7b4ace
parent087009219fd3054fca8b7510918cbaa65ad6d91f (diff)
downloadaur-db638792a9b6cb325003d33eeac478b02c595aab.tar.gz
release kernel 5.18.6
-rw-r--r--.SRCINFO8
-rw-r--r--0102-HID_apple_Properly_handle_function_keys_on_Keychron_keyboards.patch104
-rw-r--r--PKGBUILD6
3 files changed, 113 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 628095c5f1cb..9e867e2bab66 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
pkgbase = linux-acs-manjaro
- pkgver = 5.18.5
+ pkgver = 5.18.6
pkgrel = 1
url = https://www.kernel.org/
arch = x86_64
@@ -18,9 +18,10 @@ pkgbase = linux-acs-manjaro
makedepends = xz
options = !strip
source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.18.tar.xz
- source = https://www.kernel.org/pub/linux/kernel/v5.x/patch-5.18.5.xz
+ source = https://www.kernel.org/pub/linux/kernel/v5.x/patch-5.18.6.xz
source = config
source = 0101-ZEN_Add_sysctl_and_CONFIG_to_disallow_unprivileged_CLONE_NEWUSER.patch
+ source = 0102-HID_apple_Properly_handle_function_keys_on_Keychron_keyboards.patch
source = 0301-revert-fbcon-remove-now-unusued-softback_lines-cursor-argument.patch
source = 0302-revert-fbcon-remove-no-op-fbcon_set_origin.patch
source = 0303-revert-fbcon-remove-soft-scrollback-code.patch
@@ -39,9 +40,10 @@ pkgbase = linux-acs-manjaro
source = 0413-bootsplash.gitpatch
source = 0999-acs.gitpatch
sha256sums = 51f3f1684a896e797182a0907299cc1f0ff5e5b51dd9a55478ae63a409855cee
- sha256sums = fb0c52d5628f332ffe10ebaa1419c7518198f4ffe757e39c9a80229b480a36ca
+ sha256sums = e82bb2d4fc7da3cfdaec1ba3e1c03591b0a29a51f01477f977ba9bb71bad49fa
sha256sums = 2e6358fcf3db9052035eff0b03abbf28d0ad45637c35bffa10b8924bcc282a47
sha256sums = 05f04019d4a2ee072238c32860fa80d673687d84d78ef436ae9332b6fb788467
+ sha256sums = 0586d4e1295264ab86104e19835d94d71c4b5f69edafc99d2d14a8f3322f58aa
sha256sums = 2b11905b63b05b25807dd64757c779da74dd4c37e36d3f7a46485b1ee5a9d326
sha256sums = 94a8538251ad148f1025cc3de446ce64f73dc32b01815426fb159c722e8fa5bc
sha256sums = 1f18c5c10a3c63e41ecd05ad34cd9f6653ba96e9f1049ce2b7bb6da2578ae710
diff --git a/0102-HID_apple_Properly_handle_function_keys_on_Keychron_keyboards.patch b/0102-HID_apple_Properly_handle_function_keys_on_Keychron_keyboards.patch
new file mode 100644
index 000000000000..3859ed4f0701
--- /dev/null
+++ b/0102-HID_apple_Properly_handle_function_keys_on_Keychron_keyboards.patch
@@ -0,0 +1,104 @@
+From e410435c977a01e386fda83b5215540365a0086f Mon Sep 17 00:00:00 2001
+From: Bryan Cain <bryancain3@gmail.com>
+Date: Thu, 5 May 2022 13:12:21 -0600
+Subject: [PATCH] HID: apple: Properly handle function keys on Keychron
+ keyboards
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Keychron's C-series and K-series of keyboards copy the vendor and
+product IDs of an Apple keyboard, but only behave like that device when
+set to "Mac" mode. In "Windows" mode, the Fn key doesn't generate a
+scancode, so it's impossible to use the F1-F12 keys when fnmode is set
+to its default value of 1.
+
+To fix this, make fnmode default to the new value of 3, which behaves
+like fnmode=2 for Keychron keyboards and like fnmode=1 for actual Apple
+keyboards. This way, Keychron devices are fully usable in both "Windows"
+and "Mac" modes, while behavior is unchanged for everything else.
+
+Signed-off-by: Bryan Cain <bryancain3@gmail.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Tested-by: José Expósito <jose.exposito89@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+---
+ drivers/hid/hid-apple.c | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
+index 0cf35caee9fa0..42a568902f492 100644
+--- a/drivers/hid/hid-apple.c
++++ b/drivers/hid/hid-apple.c
+@@ -21,6 +21,7 @@
+ #include <linux/module.h>
+ #include <linux/slab.h>
+ #include <linux/timer.h>
++#include <linux/string.h>
+
+ #include "hid-ids.h"
+
+@@ -35,16 +36,17 @@
+ #define APPLE_NUMLOCK_EMULATION BIT(8)
+ #define APPLE_RDESC_BATTERY BIT(9)
+ #define APPLE_BACKLIGHT_CTL BIT(10)
++#define APPLE_IS_KEYCHRON BIT(11)
+
+ #define APPLE_FLAG_FKEY 0x01
+
+ #define HID_COUNTRY_INTERNATIONAL_ISO 13
+ #define APPLE_BATTERY_TIMEOUT_MS 60000
+
+-static unsigned int fnmode = 1;
++static unsigned int fnmode = 3;
+ module_param(fnmode, uint, 0644);
+ MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, "
+- "[1] = fkeyslast, 2 = fkeysfirst)");
++ "1 = fkeyslast, 2 = fkeysfirst, [3] = auto)");
+
+ static int iso_layout = -1;
+ module_param(iso_layout, int, 0644);
+@@ -349,6 +351,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
+ const struct apple_key_translation *trans, *table;
+ bool do_translate;
+ u16 code = 0;
++ unsigned int real_fnmode;
+
+ u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN);
+
+@@ -359,7 +362,13 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
+ return 1;
+ }
+
+- if (fnmode) {
++ if (fnmode == 3) {
++ real_fnmode = (asc->quirks & APPLE_IS_KEYCHRON) ? 2 : 1;
++ } else {
++ real_fnmode = fnmode;
++ }
++
++ if (real_fnmode) {
+ if (hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI ||
+ hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO ||
+ hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS ||
+@@ -406,7 +415,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
+
+ if (!code) {
+ if (trans->flags & APPLE_FLAG_FKEY) {
+- switch (fnmode) {
++ switch (real_fnmode) {
+ case 1:
+ do_translate = !asc->fn_on;
+ break;
+@@ -660,6 +669,11 @@ static int apple_input_configured(struct hid_device *hdev,
+ asc->quirks &= ~APPLE_HAS_FN;
+ }
+
++ if (strncmp(hdev->name, "Keychron", 8) == 0) {
++ hid_info(hdev, "Keychron keyboard detected; function keys will default to fnmode=2 behavior\n");
++ asc->quirks |= APPLE_IS_KEYCHRON;
++ }
++
+ return 0;
+ }
+
diff --git a/PKGBUILD b/PKGBUILD
index 61d160f90920..6787fa723548 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,7 +12,7 @@ pkgbase=linux-acs-manjaro
pkgname=('linux-acs-manjaro' 'linux-acs-manjaro-headers')
_kernelname=-ACS-MANJARO
_basekernel=5.18
-pkgver=5.18.5
+pkgver=5.18.6
pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
@@ -24,6 +24,7 @@ source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.x
'config'
# ARCH Patches
0101-ZEN_Add_sysctl_and_CONFIG_to_disallow_unprivileged_CLONE_NEWUSER.patch
+ 0102-HID_apple_Properly_handle_function_keys_on_Keychron_keyboards.patch
# MANJARO Patches
# Bootsplash
@@ -46,9 +47,10 @@ source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.x
# ACS override patch
'0999-acs.gitpatch')
sha256sums=('51f3f1684a896e797182a0907299cc1f0ff5e5b51dd9a55478ae63a409855cee'
- 'fb0c52d5628f332ffe10ebaa1419c7518198f4ffe757e39c9a80229b480a36ca'
+ 'e82bb2d4fc7da3cfdaec1ba3e1c03591b0a29a51f01477f977ba9bb71bad49fa'
'2e6358fcf3db9052035eff0b03abbf28d0ad45637c35bffa10b8924bcc282a47'
'05f04019d4a2ee072238c32860fa80d673687d84d78ef436ae9332b6fb788467'
+ '0586d4e1295264ab86104e19835d94d71c4b5f69edafc99d2d14a8f3322f58aa'
'2b11905b63b05b25807dd64757c779da74dd4c37e36d3f7a46485b1ee5a9d326'
'94a8538251ad148f1025cc3de446ce64f73dc32b01815426fb159c722e8fa5bc'
'1f18c5c10a3c63e41ecd05ad34cd9f6653ba96e9f1049ce2b7bb6da2578ae710'