diff options
| -rw-r--r-- | drivers/input/keyboard/atkbd.c | 4 | ||||
| -rw-r--r-- | drivers/input/serio/libps2.c | 18 | ||||
| -rw-r--r-- | include/linux/libps2.h | 1 |
3 files changed, 18 insertions, 5 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index ce1f10e8984b..9874072cf9d6 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
| @@ -635,9 +635,7 @@ static int atkbd_probe(struct atkbd *atkbd) | |||
| 635 | return 0; | 635 | return 0; |
| 636 | } | 636 | } |
| 637 | 637 | ||
| 638 | if (param[0] != 0xab && param[0] != 0xac && /* Regular and NCD Sun keyboards */ | 638 | if (!ps2_is_keyboard_id(param[0])) |
| 639 | param[0] != 0x2b && param[0] != 0x5d && /* Trust keyboard, raw and translated */ | ||
| 640 | param[0] != 0x60 && param[0] != 0x47) /* NMB SGI keyboard, raw and translated */ | ||
| 641 | return -1; | 639 | return -1; |
| 642 | 640 | ||
| 643 | atkbd->id = (param[0] << 8) | param[1]; | 641 | atkbd->id = (param[0] << 8) | param[1]; |
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index ed202f2f251a..e0a2297a9d21 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c | |||
| @@ -35,6 +35,7 @@ EXPORT_SYMBOL(ps2_schedule_command); | |||
| 35 | EXPORT_SYMBOL(ps2_handle_ack); | 35 | EXPORT_SYMBOL(ps2_handle_ack); |
| 36 | EXPORT_SYMBOL(ps2_handle_response); | 36 | EXPORT_SYMBOL(ps2_handle_response); |
| 37 | EXPORT_SYMBOL(ps2_cmd_aborted); | 37 | EXPORT_SYMBOL(ps2_cmd_aborted); |
| 38 | EXPORT_SYMBOL(ps2_is_keyboard_id); | ||
| 38 | 39 | ||
| 39 | /* Work structure to schedule execution of a command */ | 40 | /* Work structure to schedule execution of a command */ |
| 40 | struct ps2work { | 41 | struct ps2work { |
| @@ -102,9 +103,9 @@ void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout) | |||
| 102 | * known keyboard IDs. | 103 | * known keyboard IDs. |
| 103 | */ | 104 | */ |
| 104 | 105 | ||
| 105 | static inline int ps2_is_keyboard_id(char id_byte) | 106 | int ps2_is_keyboard_id(char id_byte) |
| 106 | { | 107 | { |
| 107 | static char keyboard_ids[] = { | 108 | const static char keyboard_ids[] = { |
| 108 | 0xab, /* Regular keyboards */ | 109 | 0xab, /* Regular keyboards */ |
| 109 | 0xac, /* NCD Sun keyboard */ | 110 | 0xac, /* NCD Sun keyboard */ |
| 110 | 0x2b, /* Trust keyboard, translated */ | 111 | 0x2b, /* Trust keyboard, translated */ |
| @@ -139,6 +140,19 @@ static int ps2_adjust_timeout(struct ps2dev *ps2dev, int command, int timeout) | |||
| 139 | 140 | ||
| 140 | case PS2_CMD_GETID: | 141 | case PS2_CMD_GETID: |
| 141 | /* | 142 | /* |
| 143 | * Microsoft Natural Elite keyboard responds to | ||
| 144 | * the GET ID command as it were a mouse, with | ||
| 145 | * a single byte. Fail the command so atkbd will | ||
| 146 | * use alternative probe to detect it. | ||
| 147 | */ | ||
| 148 | if (ps2dev->cmdbuf[1] == 0xaa) { | ||
| 149 | serio_pause_rx(ps2dev->serio); | ||
| 150 | ps2dev->flags = 0; | ||
| 151 | serio_continue_rx(ps2dev->serio); | ||
| 152 | timeout = 0; | ||
| 153 | } | ||
| 154 | |||
| 155 | /* | ||
| 142 | * If device behind the port is not a keyboard there | 156 | * If device behind the port is not a keyboard there |
| 143 | * won't be 2nd byte of ID response. | 157 | * won't be 2nd byte of ID response. |
| 144 | */ | 158 | */ |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index 08a450a9dbf7..f6f301e2b0f5 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
| @@ -47,5 +47,6 @@ int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int comman | |||
| 47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
| 48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); | 48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); |
| 49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); | 49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); |
| 50 | int ps2_is_keyboard_id(char id); | ||
| 50 | 51 | ||
| 51 | #endif /* _LIBPS2_H */ | 52 | #endif /* _LIBPS2_H */ |
