Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 55073
b: refs/heads/master
c: d2ada55
h: refs/heads/master
i:
  55071: 2518d1b
v: v3
  • Loading branch information
Roland Scheidegger authored and Dmitry Torokhov committed May 8, 2007
1 parent 4e6178a commit d399620
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 334d0dd8b660557608142f0f77abc6812b48f08b
refs/heads/master: d2ada5597d33a9108acb2caf912f85cbc9caab1e
35 changes: 29 additions & 6 deletions trunk/drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,33 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id)
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
Expand Down Expand Up @@ -580,16 +607,12 @@ static int __devinit i8042_check_aux(void)
* 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;

/*
Expand Down

0 comments on commit d399620

Please sign in to comment.