]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Input: i8042 - another attempt to fix AUX delivery checks
authorDmitry Torokhov <dtor@insightbb.com>
Thu, 8 Mar 2007 04:20:55 +0000 (23:20 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 23 Mar 2007 19:49:27 +0000 (12:49 -0700)
Do not assume that AUX_LOOP command is broken unless it
completes successfully but returns wrong (unexpected) data.

Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/input/serio/i8042.c

index c3fdfc1f342a2fdd38b35e1294adc77ca0d44d9e..3b12996bcdee21b4104dd8708d11ad3667d769da 100644 (file)
@@ -560,7 +560,8 @@ static int __devinit i8042_check_aux(void)
  */
 
        param = 0x5a;
-       if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0x5a) {
+       retval = i8042_command(&param, I8042_CMD_AUX_LOOP);
+       if (retval || param != 0x5a) {
 
 /*
  * External connection test - filters out AT-soldered PS/2 i8042's
@@ -574,7 +575,12 @@ static int __devinit i8042_check_aux(void)
                    (param && param != 0xfa && param != 0xff))
                        return -1;
 
-               aux_loop_broken = 1;
+/*
+ * If AUX_LOOP completed without error but returned unexpected data
+ * mark it as broken
+ */
+               if (!retval)
+                       aux_loop_broken = 1;
        }
 
 /*