HID: apple: Add support for recent firmware
PATCH 1/1 HID: apple: Add support for recent firmware
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.
--- drivers/hid/hid-apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-apple.c +2 -1
@@ -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 );
Signature · 1 line
2.25.0
Jiri Kosina
maintainerQuoted 15 lines · Mansour Behabadi
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 viahid_applefnmode module parameter.Signed-off-by Mansour Behabadi <[email protected]>--- drivers/hid/hid-apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/hid/hid-apple.c +0
-0
drivers/hid/hid-apple.c static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, · line 345
Quoted 7 lines
drivers/hid/hid-apple.c +2
-1@@ -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 */
Hmm, one day we should probably ditch this "vendor-specific" naming, which doesn't really match reality at all any more.
Also the mappings in hid-input for these usage pages are pretty awkward these days.
Anyway, that is for later. I am queuing your patch now, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs