diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-10-12 21:27:47 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-10-12 21:27:47 -0400 |
commit | b981d8b3f5e008ff10d993be633ad00564fc22cd (patch) | |
tree | e292dc07b22308912cf6a58354a608b9e5e8e1fd /drivers/macintosh/adbhid.c | |
parent | b11d2127c4893a7315d1e16273bc8560049fa3ca (diff) | |
parent | 2b9e0aae1d50e880c58d46788e5e3ebd89d75d62 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/macintosh/adbhid.c
Diffstat (limited to 'drivers/macintosh/adbhid.c')
-rw-r--r-- | drivers/macintosh/adbhid.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index 9ff2189d2e2a..8cce016b3d09 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c | |||
@@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = { | |||
75 | #define ADB_KEY_POWER_OLD 0x7e | 75 | #define ADB_KEY_POWER_OLD 0x7e |
76 | #define ADB_KEY_POWER 0x7f | 76 | #define ADB_KEY_POWER 0x7f |
77 | 77 | ||
78 | u8 adb_to_linux_keycodes[128] = { | 78 | u16 adb_to_linux_keycodes[128] = { |
79 | /* 0x00 */ KEY_A, /* 30 */ | 79 | /* 0x00 */ KEY_A, /* 30 */ |
80 | /* 0x01 */ KEY_S, /* 31 */ | 80 | /* 0x01 */ KEY_S, /* 31 */ |
81 | /* 0x02 */ KEY_D, /* 32 */ | 81 | /* 0x02 */ KEY_D, /* 32 */ |
@@ -139,7 +139,7 @@ u8 adb_to_linux_keycodes[128] = { | |||
139 | /* 0x3c */ KEY_RIGHT, /* 106 */ | 139 | /* 0x3c */ KEY_RIGHT, /* 106 */ |
140 | /* 0x3d */ KEY_DOWN, /* 108 */ | 140 | /* 0x3d */ KEY_DOWN, /* 108 */ |
141 | /* 0x3e */ KEY_UP, /* 103 */ | 141 | /* 0x3e */ KEY_UP, /* 103 */ |
142 | /* 0x3f */ 0, | 142 | /* 0x3f */ KEY_FN, /* 0x1d0 */ |
143 | /* 0x40 */ 0, | 143 | /* 0x40 */ 0, |
144 | /* 0x41 */ KEY_KPDOT, /* 83 */ | 144 | /* 0x41 */ KEY_KPDOT, /* 83 */ |
145 | /* 0x42 */ 0, | 145 | /* 0x42 */ 0, |
@@ -213,7 +213,7 @@ struct adbhid { | |||
213 | int original_handler_id; | 213 | int original_handler_id; |
214 | int current_handler_id; | 214 | int current_handler_id; |
215 | int mouse_kind; | 215 | int mouse_kind; |
216 | unsigned char *keycode; | 216 | u16 *keycode; |
217 | char name[64]; | 217 | char name[64]; |
218 | char phys[32]; | 218 | char phys[32]; |
219 | int flags; | 219 | int flags; |
@@ -334,7 +334,7 @@ adbhid_input_keycode(int id, int scancode, int repeat) | |||
334 | keycode = ADB_KEY_POWER; | 334 | keycode = ADB_KEY_POWER; |
335 | } | 335 | } |
336 | break; | 336 | break; |
337 | case ADB_KEY_POWER: | 337 | case ADB_KEY_POWER: |
338 | /* Fn + Command will produce a bogus "power" keycode */ | 338 | /* Fn + Command will produce a bogus "power" keycode */ |
339 | if (ahid->flags & FLAG_FN_KEY_PRESSED) { | 339 | if (ahid->flags & FLAG_FN_KEY_PRESSED) { |
340 | keycode = ADB_KEY_CMD; | 340 | keycode = ADB_KEY_CMD; |
@@ -359,8 +359,7 @@ adbhid_input_keycode(int id, int scancode, int repeat) | |||
359 | } | 359 | } |
360 | } else | 360 | } else |
361 | ahid->flags |= FLAG_FN_KEY_PRESSED; | 361 | ahid->flags |= FLAG_FN_KEY_PRESSED; |
362 | /* Swallow the key press */ | 362 | break; |
363 | return; | ||
364 | case ADB_KEY_DEL: | 363 | case ADB_KEY_DEL: |
365 | /* Emulate Fn+delete = forward delete */ | 364 | /* Emulate Fn+delete = forward delete */ |
366 | if (ahid->flags & FLAG_FN_KEY_PRESSED) { | 365 | if (ahid->flags & FLAG_FN_KEY_PRESSED) { |
@@ -374,9 +373,9 @@ adbhid_input_keycode(int id, int scancode, int repeat) | |||
374 | #endif /* CONFIG_PPC_PMAC */ | 373 | #endif /* CONFIG_PPC_PMAC */ |
375 | } | 374 | } |
376 | 375 | ||
377 | if (adbhid[id]->keycode[keycode]) { | 376 | key = adbhid[id]->keycode[keycode]; |
378 | input_report_key(adbhid[id]->input, | 377 | if (key) { |
379 | adbhid[id]->keycode[keycode], !up_flag); | 378 | input_report_key(adbhid[id]->input, key, !up_flag); |
380 | input_sync(adbhid[id]->input); | 379 | input_sync(adbhid[id]->input); |
381 | } else | 380 | } else |
382 | printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode, | 381 | printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode, |
@@ -795,8 +794,8 @@ adbhid_input_register(int id, int default_id, int original_handler_id, | |||
795 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); | 794 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); |
796 | input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML); | 795 | input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML); |
797 | input_dev->event = adbhid_kbd_event; | 796 | input_dev->event = adbhid_kbd_event; |
798 | input_dev->keycodemax = 127; | 797 | input_dev->keycodemax = KEY_FN; |
799 | input_dev->keycodesize = 1; | 798 | input_dev->keycodesize = sizeof(hid->keycode[0]); |
800 | break; | 799 | break; |
801 | 800 | ||
802 | case ADB_MOUSE: | 801 | case ADB_MOUSE: |