From: Vojtech P. <vo...@us...> - 2002-02-02 22:26:47
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv27871 Modified Files: i8042.c i8042.h q40kbd.c Log Message: i8042.c: Make timeout longer and bus speed independent. q40kbd.c: Remove dummy write method. atkbd.c now detects that and doesn't try detecting/initalizing the keyboard. Index: i8042.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- i8042.c 2002/01/22 20:43:24 1.16 +++ i8042.c 2002/02/02 22:26:44 1.17 @@ -96,14 +96,20 @@ static int i8042_wait_read(void) { int i = 0; - while ((~inb(I8042_STATUS_REG) & I8042_STR_OBF) && (i < I8042_CTL_TIMEOUT)) i++; + while ((~inb(I8042_STATUS_REG) & I8042_STR_OBF) && (i < I8042_CTL_TIMEOUT)) { + udelay(50); + i++; + } return -(i == I8042_CTL_TIMEOUT); } static int i8042_wait_write(void) { int i = 0; - while ((inb(I8042_STATUS_REG) & I8042_STR_IBF) && (i < I8042_CTL_TIMEOUT)) i++; + while ((inb(I8042_STATUS_REG) & I8042_STR_IBF) && (i < I8042_CTL_TIMEOUT)) { + udelay(50); + i++; + } return -(i == I8042_CTL_TIMEOUT); } @@ -181,14 +187,17 @@ spin_unlock_irqrestore(&i8042_lock, flags); +#ifdef I8042_DEBUG_IO + if (retval) + printk(KERN_DEBUG "i8042.c: -- i8042 (timeout) [%d]\n", + (int) (jiffies - i8042_start)); +#endif + return retval; } /* * i8042_kbd_write() sends a byte out through the keyboard interface. - * It also automatically refreshes the CTR value, since some i8042's - * trash their CTR after attempting to send data to an nonexistent - * device. */ static int i8042_kbd_write(struct serio *port, unsigned char c) Index: i8042.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- i8042.h 2002/01/22 20:43:42 1.8 +++ i8042.h 2002/02/02 22:26:44 1.9 @@ -55,12 +55,12 @@ #define I8042_AUX_IRQ CONFIG_I8042_AUX_IRQ /* - * The speed of the i8042's varies. This timeout equals 100 ms on a system - * with 8.3 MHz i8042 clock, which should be most common. It should not need - * to be raised / lowered. + * This is in 50us units, the time we wait for the i8042 to react. This + * has to be long enough for the i8042 itself to timeout on sending a byte + * to a non-existent mouse. */ -#define I8042_CTL_TIMEOUT 83000 +#define I8042_CTL_TIMEOUT 10000 /* * Register numbers. Index: q40kbd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/q40kbd.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- q40kbd.c 2002/02/01 00:54:24 1.11 +++ q40kbd.c 2002/02/02 22:26:44 1.12 @@ -47,15 +47,10 @@ MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver"); MODULE_LICENSE("GPL"); -static inline void q40kbd_write(unsigned char val) -{ - /* No way to write to the keyboard! */ -} - static struct serio q40kbd_port = { type: SERIO_8042, - write: q40kbd_write, + write: NULL, name: "Q40 PS/2 kbd port", phys: "isa0060/serio0", }; |