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>
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index ed202f2..e0a2297 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -35,6 +35,7 @@
 EXPORT_SYMBOL(ps2_handle_ack);
 EXPORT_SYMBOL(ps2_handle_response);
 EXPORT_SYMBOL(ps2_cmd_aborted);
+EXPORT_SYMBOL(ps2_is_keyboard_id);
 
 /* Work structure to schedule execution of a command */
 struct ps2work {
@@ -102,9 +103,9 @@
  * known keyboard IDs.
  */
 
-static inline int ps2_is_keyboard_id(char id_byte)
+int ps2_is_keyboard_id(char id_byte)
 {
-	static char keyboard_ids[] = {
+	const static char keyboard_ids[] = {
 		0xab,	/* Regular keyboards		*/
 		0xac,	/* NCD Sun keyboard		*/
 		0x2b,	/* Trust keyboard, translated	*/
@@ -139,6 +140,19 @@
 
 		case PS2_CMD_GETID:
 			/*
+			 * Microsoft Natural Elite keyboard responds to
+			 * the GET ID command as it were a mouse, with
+			 * a single byte. Fail the command so atkbd will
+			 * use alternative probe to detect it.
+			 */
+			if (ps2dev->cmdbuf[1] == 0xaa) {
+				serio_pause_rx(ps2dev->serio);
+				ps2dev->flags = 0;
+				serio_continue_rx(ps2dev->serio);
+				timeout = 0;
+			}
+
+			/*
 			 * If device behind the port is not a keyboard there
 			 * won't be 2nd byte of ID response.
 			 */