Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40989
b: refs/heads/master
c: bb7eef6
h: refs/heads/master
i:
  40987: 62cf9b6
v: v3
  • Loading branch information
Olaf Hering authored and Greg Kroah-Hartman committed Nov 16, 2006
1 parent 89df8b9 commit 83d0069
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 583ceada075597a5b6acab1140d61ac81586a2a6
refs/heads/master: bb7eef6eea53633a8a49f014fd27c08f7d5fda1a
4 changes: 2 additions & 2 deletions trunk/drivers/usb/input/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,10 +1797,10 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
{ USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
{ USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN },
{ USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN },
Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/usb/input/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ static struct hidinput_key_translation powerbook_numlock_keys[] = {
{ }
};

static struct hidinput_key_translation powerbook_iso_keyboard[] = {
{ KEY_GRAVE, KEY_102ND },
{ KEY_102ND, KEY_GRAVE },
{ }
};

static int usbhid_pb_fnmode = 1;
module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
MODULE_PARM_DESC(pb_fnmode,
Expand Down Expand Up @@ -195,6 +201,14 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
}
}

if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) {
trans = find_translation(powerbook_iso_keyboard, usage->code);
if (trans) {
input_event(input, usage->type, trans->to, value);
return 1;
}
}

return 0;
}

Expand All @@ -210,6 +224,9 @@ static void hidinput_pb_setup(struct input_dev *input)

for (trans = powerbook_numlock_keys; trans->from; trans++)
set_bit(trans->to, input->keybit);

for (trans = powerbook_iso_keyboard; trans->from; trans++)
set_bit(trans->to, input->keybit);
}
#else
static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/input/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ struct hid_item {
#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000
#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000
#define HID_QUIRK_INVERT_HWHEEL 0x00004000
#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000

/*
* This is the global environment of the parser. This information is
Expand Down

0 comments on commit 83d0069

Please sign in to comment.