diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-14 01:31:27 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-14 01:31:27 -0400 |
commit | 9807879bfdc0c2b5106b4b378f5475c6a333d853 (patch) | |
tree | 2a761ae4d03b35e371044014af4addcc23f326da /drivers/input | |
parent | a91eaa16df5cd6c552e3a4a6e40e60ffbd9be951 (diff) |
Input: atkbd - support Microsoft Natural Elite Pro keyboards
Microsoft Natural Elite Pro keyboard produces unisual response to
the GET ID command - single byte 0xaa (normally keyboards produce
2-byte response). Fail GET ID command so atkbd gets a change to
do alternate probe.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 4 | ||||
-rw-r--r-- | drivers/input/serio/libps2.c | 18 |
2 files changed, 17 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 | */ |