Skip to contentSkip to conversation

ps2kbd: default to scancode_set 2, as with KBD_CMD_RESET

PATCH In review Hervé Poussineau 2 participants 2 messages Mar 23, 2016 – Apr 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ps2kbd: default to scancode_set 2, as with KBD_CMD_RESET

This line has been added in commit ef74679a810fe6858f625b9d52b68cc3fc61eb3d with other initializations. However, scancode set 0 doesn't exist (only 1, 2, 3). This works well as long as operating system is resetting keyboard, or overwriting the current scancode set with the one it wants.

This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET or KBD_CMD_SCANCODE.

---
 hw/input/ps2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/input/ps2.c +1 -1
index 58892d5..a8aa36f 100644
@@ -628,7 +628,7 @@ static void ps2_kbd_reset(void *opaque)
     ps2_common_reset(&s->common);
     s->scan_enabled = 0;
     s->translate = 0;
-    s->scancode_set = 0;
+    s->scancode_set = 2;
 }
 
 static void ps2_mouse_reset(void *opaque)
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Hervé Poussineau

This line has been added in commit ef74679a810fe6858f625b9d52b68cc3fc61eb3d with other initializations. However, scancode set 0 doesn't exist (only 1, 2, 3). This works well as long as operating system is resetting keyboard, or overwriting the current scancode set with the one it wants.

This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET or KBD_CMD_SCANCODE.

Matches reset behavior documented at
http://www.computer-engineering.org/ps2keyboard/ (the best source I could find for the PS/2 specs).

Michael, do you want to merge this through the PC tree?

Quoted 20 lines
---
 hw/input/ps2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/input/ps2.c +1 -1
index 58892d5..a8aa36f 100644
@@ -628,7 +628,7 @@ static void ps2_kbd_reset(void *opaque)
     ps2_common_reset(&s->common);
     s->scan_enabled = 0;
     s->translate = 0;
-    s->scancode_set = 0;
+    s->scancode_set = 2;
 }
 
 static void ps2_mouse_reset(void *opaque)
Signature · 1 line
2.1.4
Signature · 1 line
Eduardo