aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/hid-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/input/hid-input.c')
-rw-r--r--drivers/usb/input/hid-input.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
index 9a808a3b4d37..68e7ebb978a9 100644
--- a/drivers/usb/input/hid-input.c
+++ b/drivers/usb/input/hid-input.c
@@ -121,6 +121,12 @@ static struct hidinput_key_translation powerbook_numlock_keys[] = {
121 { } 121 { }
122}; 122};
123 123
124static struct hidinput_key_translation powerbook_iso_keyboard[] = {
125 { KEY_GRAVE, KEY_102ND },
126 { KEY_102ND, KEY_GRAVE },
127 { }
128};
129
124static int usbhid_pb_fnmode = 1; 130static int usbhid_pb_fnmode = 1;
125module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); 131module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
126MODULE_PARM_DESC(pb_fnmode, 132MODULE_PARM_DESC(pb_fnmode,
@@ -195,6 +201,14 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
195 } 201 }
196 } 202 }
197 203
204 if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) {
205 trans = find_translation(powerbook_iso_keyboard, usage->code);
206 if (trans) {
207 input_event(input, usage->type, trans->to, value);
208 return 1;
209 }
210 }
211
198 return 0; 212 return 0;
199} 213}
200 214
@@ -210,6 +224,9 @@ static void hidinput_pb_setup(struct input_dev *input)
210 224
211 for (trans = powerbook_numlock_keys; trans->from; trans++) 225 for (trans = powerbook_numlock_keys; trans->from; trans++)
212 set_bit(trans->to, input->keybit); 226 set_bit(trans->to, input->keybit);
227
228 for (trans = powerbook_iso_keyboard; trans->from; trans++)
229 set_bit(trans->to, input->keybit);
213} 230}
214#else 231#else
215static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, 232static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,