From fd5b3704374c9ca7d57627f9d449536d02b9baf0 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 10 Jan 2014 20:40:59 +0100 Subject: libpayload: Bring keyboard_wait_write() back Code is using it... Change-Id: I6894b45cbbf70c8e7ce37ce18d93cadf0ea9fbfc Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/4649 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Nico Huber --- payloads/libpayload/drivers/keyboard.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'payloads/libpayload') 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. -- cgit v1.2.3