]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
HID: apple: Add support for recent firmware on Magic Keyboards
authorMansour Behabadi <mansour@oxplot.com>
Wed, 29 Jan 2020 06:26:31 +0000 (17:26 +1100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 23 Mar 2020 10:24:25 +0000 (11:24 +0100)
BugLink: https://bugs.launchpad.net/bugs/1868538
[ Upstream commit e433be929e63265b7412478eb7ff271467aee2d7 ]

Magic Keyboards with more recent firmware (0x0100) report Fn key differently.
Without this patch, Fn key may not behave as expected and may not be
configurable via hid_apple fnmode module parameter.

Signed-off-by: Mansour Behabadi <mansour@oxplot.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/hid/hid-apple.c

index 6ac8becc2372efdd303ba29d14a246e9f5290239..d732d1d10cafb7bbafbf27ec59ff17bd5aae2c94 100644 (file)
@@ -340,7 +340,8 @@ static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
                unsigned long **bit, int *max)
 {
        if (usage->hid == (HID_UP_CUSTOM | 0x0003) ||
-                       usage->hid == (HID_UP_MSVENDOR | 0x0003)) {
+                       usage->hid == (HID_UP_MSVENDOR | 0x0003) ||
+                       usage->hid == (HID_UP_HPVENDOR2 | 0x0003)) {
                /* The fn key on Apple USB keyboards */
                set_bit(EV_REP, hi->input->evbit);
                hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN);