diff options
author | Olaf Hering <olh@suse.de> | 2006-11-08 22:58:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-11-16 17:26:11 -0500 |
commit | bb7eef6eea53633a8a49f014fd27c08f7d5fda1a (patch) | |
tree | 955a168d1124910864c4970c11045a1177279c44 /drivers/usb/input/hid-input.c | |
parent | 583ceada075597a5b6acab1140d61ac81586a2a6 (diff) |
USB: correct keymapping on Powerbook built-in USB ISO keyboards
similar to the version in adbhid_input_register(): The '<>' key and the
'^°' key on a german keyboard is swapped. Provide correct keys to
userland, external USB keyboards will not work correctly when the
'badmap'/'goodmap' workarounds from xkeyboard-config are used.
It is expected that distributions drop the badmap/goodmap part from
keycodes/macintosh in the xkeyboard-config package.
This is probably 2.6.18.x material, if major distros settle on 2.6.18.
Signed-off-by: Olaf Hering <olh@suse.de>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/input/hid-input.c')
-rw-r--r-- | drivers/usb/input/hid-input.c | 17 |
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 | ||
124 | static struct hidinput_key_translation powerbook_iso_keyboard[] = { | ||
125 | { KEY_GRAVE, KEY_102ND }, | ||
126 | { KEY_102ND, KEY_GRAVE }, | ||
127 | { } | ||
128 | }; | ||
129 | |||
124 | static int usbhid_pb_fnmode = 1; | 130 | static int usbhid_pb_fnmode = 1; |
125 | module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); | 131 | module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); |
126 | MODULE_PARM_DESC(pb_fnmode, | 132 | MODULE_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 |
215 | static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | 232 | static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, |