]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add i8042 fix to 2.6.20
authorChris Wright <chrisw@sous-sol.org>
Mon, 11 Jun 2007 17:22:57 +0000 (10:22 -0700)
committerChris Wright <chrisw@sous-sol.org>
Mon, 11 Jun 2007 17:22:57 +0000 (10:22 -0700)
review-2.6.20/input-i8042-fix-aux-port-detection-with-some-chips.patch [new file with mode: 0644]
review-2.6.20/series

diff --git a/review-2.6.20/input-i8042-fix-aux-port-detection-with-some-chips.patch b/review-2.6.20/input-i8042-fix-aux-port-detection-with-some-chips.patch
new file mode 100644 (file)
index 0000000..502b330
--- /dev/null
@@ -0,0 +1,81 @@
+From stable-bounces@linux.kernel.org  Thu May 24 06:38:57 2007
+Message-ID: <4655951B.5000501@gentoo.org>
+Date: Thu, 24 May 2007 09:37:31 -0400
+From: Daniel Drake <dsd@gentoo.org>
+To: stable@kernel.org
+Subject: Input: i8042 - fix AUX port detection with some chips
+
+From: Roland Scheidegger <sroland@tungstengraphics.com>
+
+The i8042 driver fails detection of the AUX port with some chips,
+because they apparently do not change the I8042_CTR_AUXDIS bit
+immediately. This is known to affect at least HP500/HP510 notebooks,
+consequently the built-in touchpad will not work. The patch will simply
+reread the value until it gets the expected value or a retry limit is
+hit, without touching other workaround code in the same area.
+
+Signed-off-by: Roland Scheidegger <sroland@tungstengraphics.com>
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=d2ada5597d33a9108acb2caf912f85cbc9caab1e
+
+ drivers/input/serio/i8042.c |   35 +++++++++++++++++++++++++++++------
+ 1 file changed, 29 insertions(+), 6 deletions(-)
+
+--- linux-2.6.20.13.orig/drivers/input/serio/i8042.c
++++ linux-2.6.20.13/drivers/input/serio/i8042.c
+@@ -533,6 +533,33 @@ static irqreturn_t __devinit i8042_aux_t
+       return IRQ_HANDLED;
+ }
++/*
++ * i8042_toggle_aux - enables or disables AUX port on i8042 via command and
++ * verifies success by readinng CTR. Used when testing for presence of AUX
++ * port.
++ */
++static int __devinit i8042_toggle_aux(int on)
++{
++      unsigned char param;
++      int i;
++
++      if (i8042_command(&param,
++                      on ? I8042_CMD_AUX_ENABLE : I8042_CMD_AUX_DISABLE))
++              return -1;
++
++      /* some chips need some time to set the I8042_CTR_AUXDIS bit */
++      for (i = 0; i < 100; i++) {
++              udelay(50);
++
++              if (i8042_command(&param, I8042_CMD_CTL_RCTR))
++                      return -1;
++
++              if (!(param & I8042_CTR_AUXDIS) == on)
++                      return 0;
++      }
++
++      return -1;
++}
+ /*
+  * i8042_check_aux() applies as much paranoia as it can at detecting
+@@ -587,16 +614,12 @@ static int __devinit i8042_check_aux(voi
+  * Bit assignment test - filters out PS/2 i8042's in AT mode
+  */
+-      if (i8042_command(&param, I8042_CMD_AUX_DISABLE))
+-              return -1;
+-      if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) {
++      if (i8042_toggle_aux(0)) {
+               printk(KERN_WARNING "Failed to disable AUX port, but continuing anyway... Is this a SiS?\n");
+               printk(KERN_WARNING "If AUX port is really absent please use the 'i8042.noaux' option.\n");
+       }
+-      if (i8042_command(&param, I8042_CMD_AUX_ENABLE))
+-              return -1;
+-      if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (param & I8042_CTR_AUXDIS))
++      if (i8042_toggle_aux(1))
+               return -1;
+ /*
index 6337a555877355fdefa0e8919ed39d493b54ba7c..564bd93f7fb369df4df5c7f0754d5c0c1130282b 100644 (file)
@@ -30,3 +30,4 @@ net-fix-race-condition-about-network-device-name-allocation.patch
 fix-af_unix-oops.patch
 ipv6-route-no-longer-handle-0-specially.patch
 sparc64-don-t-be-picky-about-virtual-dma-values-on-sun4v.patch
+input-i8042-fix-aux-port-detection-with-some-chips.patch