summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2014-01-10 20:40:59 +0100
committerNico Huber <nico.h@gmx.de>2014-01-19 11:37:39 +0100
commitfd5b3704374c9ca7d57627f9d449536d02b9baf0 (patch)
tree8d1861994a543513457b4c0474f614ce6d750b42 /payloads/libpayload/drivers
parent5fb48a85dc9f3fdb28779b92eb19870615d32322 (diff)
downloadcoreboot-fd5b3704374c9ca7d57627f9d449536d02b9baf0.tar.xz
libpayload: Bring keyboard_wait_write() back
Code is using it... Change-Id: I6894b45cbbf70c8e7ce37ce18d93cadf0ea9fbfc Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4649 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r--payloads/libpayload/drivers/keyboard.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/keyboard.c b/payloads/libpayload/drivers/keyboard.c
index 0175bc74d9..ddedbd3942 100644
--- a/payloads/libpayload/drivers/keyboard.c
+++ b/payloads/libpayload/drivers/keyboard.c
@@ -258,6 +258,16 @@ int keyboard_getchar(void)
return ret;
}
+static int keyboard_wait_write(void)
+{
+ int retries = 10000;
+
+ while(retries-- && (inb(0x64) & 0x02))
+ udelay(50);
+
+ return (retries <= 0) ? -1 : 0;
+}
+
/**
* Set keyboard layout
* @param country string describing the keyboard layout language.