Commit acb5033c authored by Vojtech Pavlik's avatar Vojtech Pavlik

input: Don't even try to reset the i8042 controller when it's not

       willing to talk to us at all - it's probably not there.
Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
parent 29a1cbe4
...@@ -162,16 +162,17 @@ static int i8042_wait_write(void) ...@@ -162,16 +162,17 @@ static int i8042_wait_write(void)
static int i8042_flush(void) static int i8042_flush(void)
{ {
unsigned long flags; unsigned long flags;
unsigned char data; unsigned char data, str;
int i = 0; int i = 0;
spin_lock_irqsave(&i8042_lock, flags); spin_lock_irqsave(&i8042_lock, flags);
while ((i8042_read_status() & I8042_STR_OBF) && (i++ < I8042_BUFFER_SIZE)) { while (((str = i8042_read_status()) & I8042_STR_OBF) && (i < I8042_BUFFER_SIZE)) {
udelay(50); udelay(50);
data = i8042_read_data(); data = i8042_read_data();
i++;
dbg("%02x <- i8042 (flush, %s)", data, dbg("%02x <- i8042 (flush, %s)", data,
i8042_read_status() & I8042_STR_AUXDATA ? "aux" : "kbd"); str & I8042_STR_AUXDATA ? "aux" : "kbd");
} }
spin_unlock_irqrestore(&i8042_lock, flags); spin_unlock_irqrestore(&i8042_lock, flags);
...@@ -713,7 +714,10 @@ static int i8042_controller_init(void) ...@@ -713,7 +714,10 @@ static int i8042_controller_init(void)
* before doing anything else. * before doing anything else.
*/ */
i8042_flush(); if (i8042_flush() == I8042_BUFFER_SIZE) {
printk(KERN_ERR "i8042.c: No controller found.\n");
return -1;
}
if (i8042_reset) { if (i8042_reset) {
......
...@@ -100,10 +100,10 @@ ...@@ -100,10 +100,10 @@
/* /*
* Expected maximum internal i8042 buffer size. This is used for flushing * Expected maximum internal i8042 buffer size. This is used for flushing
* the i8042 buffers. 32 should be more than enough. * the i8042 buffers.
*/ */
#define I8042_BUFFER_SIZE 32 #define I8042_BUFFER_SIZE 16
/* /*
* Number of AUX ports on controllers supporting active multiplexing * Number of AUX ports on controllers supporting active multiplexing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment