[coreboot] New patch to review for coreboot: 20f62da libpayload: Fix handling of CAPS LOCK key on PS/2 keyboards

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Thu Nov 10 15:52:15 CET 2011


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/430

-gerrit

commit 20f62dac1e7c8f6eb6116a88fc729794d05742d6
Author: Patrick Georgi <patrick.georgi at secunet.com>
Date:   Thu Nov 10 15:48:37 2011 +0100

    libpayload: Fix handling of CAPS LOCK key on PS/2 keyboards
    
    The PS/2 keyboard driver set and reset the caps LED to show the
    keyboard status. Unfortunately, that configuration happens over
    the same path used to transmit keypresses.
    
    In face of certain error conditions, the keyboard stopped working.
    This change makes keyboard handling more robust.
    
    Change-Id: I0489a9983ea7dab00357220e09398dd1a8538839
    Signed-off-by: Patrick Georgi <patrick.georgi at secunet.com>
---
 payloads/libpayload/drivers/keyboard.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/drivers/keyboard.c b/payloads/libpayload/drivers/keyboard.c
index 0663f47..717ee55 100644
--- a/payloads/libpayload/drivers/keyboard.c
+++ b/payloads/libpayload/drivers/keyboard.c
@@ -166,11 +166,13 @@ static struct layout_maps keyboard_layouts[] = {
 
 static void keyboard_cmd(unsigned char cmd, unsigned char val)
 {
+	while (inb(0x64) & 2);
 	outb(cmd, 0x60);
-	/* wait until keyboard controller accepts cmds: */
+	mdelay(20);
+
 	while (inb(0x64) & 2);
 	outb(val, 0x60);
-	while (inb(0x64) & 2);
+	mdelay(20);
 }
 
 int keyboard_havechar(void)




More information about the coreboot mailing list