HID: apple: Magic Keyboard first generation FN key mapping
authorJosé Expósito <jose.exposito89@gmail.com>
Tue, 8 Feb 2022 18:37:03 +0000 (19:37 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 16 Feb 2022 15:49:45 +0000 (16:49 +0100)
commit0fea6fe7d5ef1b5fa5f78048d4729f85181c04ca
tree190667bff2a76e3977aa947da4b17c20d372f713
parentf1d1b3a9b41125d8a98b6ec94713715af332ffb1
HID: apple: Magic Keyboard first generation FN key mapping

The function key mapping for the Magic Keyboard first generation (2007,
2009 and 2011 aluminum wireless models) was not present and the default
one was used instead.

This caused two main issues:

 - The F5 and F6 keys were sending KEY_KBDILLUMDOWN and KEY_KBDILLUMUP;
   however, the keyboard is not backlited.

 - The keyboard has the APPLE_NUMLOCK_EMULATION quirk with F6 set as
   the KEY_NUMLOCK key by "powerbook_numlock_keys". However, because F6
   was mapped to KEY_KBDILLUMUP by the default mapping it was not
   possible to switch the numlock status.
   This means that, if numlock was enabled on session startup, it was
   not possible to disable it without connecting another keyboard.

Add a custom translation table for the device leaving F5 unassigned and
using F6 as the KEY_NUMLOCK key.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-apple.c