/[linux-patches]/genpatches-2.6/tags/2.6.21-4/2600_i8042-aux-detection.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.21-4/2600_i8042-aux-detection.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 974 - (show annotations) (download)
Thu May 24 23:17:59 2007 UTC (11 years, 4 months ago) by dsd
File size: 2594 byte(s)
2.6.21-4 release
1 From: Roland Scheidegger <sroland@tungstengraphics.com>
2 Date: Tue, 8 May 2007 05:31:40 +0000 (-0400)
3 Subject: Input: i8042 - fix AUX port detection with some chips
4 X-Git-Tag: v2.6.22-rc1~357^2~5
5 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=d2ada5597d33a9108acb2caf912f85cbc9caab1e
6
7 Input: i8042 - fix AUX port detection with some chips
8
9 The i8042 driver fails detection of the AUX port with some chips,
10 because they apparently do not change the I8042_CTR_AUXDIS bit
11 immediately. This is known to affect at least HP500/HP510 notebooks,
12 consequently the built-in touchpad will not work. The patch will simply
13 reread the value until it gets the expected value or a retry limit is
14 hit, without touching other workaround code in the same area.
15
16 Signed-off-by: Roland Scheidegger <sroland@tungstengraphics.com>
17 Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
18 ---
19
20 diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
21 index 7c17377..3888dc3 100644
22 --- a/drivers/input/serio/i8042.c
23 +++ b/drivers/input/serio/i8042.c
24 @@ -526,6 +526,33 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id)
25 return IRQ_HANDLED;
26 }
27
28 +/*
29 + * i8042_toggle_aux - enables or disables AUX port on i8042 via command and
30 + * verifies success by readinng CTR. Used when testing for presence of AUX
31 + * port.
32 + */
33 +static int __devinit i8042_toggle_aux(int on)
34 +{
35 + unsigned char param;
36 + int i;
37 +
38 + if (i8042_command(&param,
39 + on ? I8042_CMD_AUX_ENABLE : I8042_CMD_AUX_DISABLE))
40 + return -1;
41 +
42 + /* some chips need some time to set the I8042_CTR_AUXDIS bit */
43 + for (i = 0; i < 100; i++) {
44 + udelay(50);
45 +
46 + if (i8042_command(&param, I8042_CMD_CTL_RCTR))
47 + return -1;
48 +
49 + if (!(param & I8042_CTR_AUXDIS) == on)
50 + return 0;
51 + }
52 +
53 + return -1;
54 +}
55
56 /*
57 * i8042_check_aux() applies as much paranoia as it can at detecting
58 @@ -580,16 +607,12 @@ static int __devinit i8042_check_aux(void)
59 * Bit assignment test - filters out PS/2 i8042's in AT mode
60 */
61
62 - if (i8042_command(&param, I8042_CMD_AUX_DISABLE))
63 - return -1;
64 - if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) {
65 + if (i8042_toggle_aux(0)) {
66 printk(KERN_WARNING "Failed to disable AUX port, but continuing anyway... Is this a SiS?\n");
67 printk(KERN_WARNING "If AUX port is really absent please use the 'i8042.noaux' option.\n");
68 }
69
70 - if (i8042_command(&param, I8042_CMD_AUX_ENABLE))
71 - return -1;
72 - if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (param & I8042_CTR_AUXDIS))
73 + if (i8042_toggle_aux(1))
74 return -1;
75
76 /*

  ViewVC Help
Powered by ViewVC 1.1.20