Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1661
b: refs/heads/master
c: 2673c83
h: refs/heads/master
i:
  1659: fed13d7
v: v3
  • Loading branch information
Vojtech Pavlik authored and Dmitry Torokhov committed May 28, 2005
1 parent fcf62f2 commit 96e9fc8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 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: be15692310ec0e93998d763931089cb21386a058
refs/heads/master: 2673c836ab9a44b02d45ae5c1c44c03df138dba4
48 changes: 28 additions & 20 deletions trunk/drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,26 @@ static void i8042_timer_func(unsigned long data)
i8042_interrupt(0, NULL, NULL);
}

static int i8042_ctl_test(void)
{
unsigned char param;

if (!i8042_reset)
return 0;

if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
return -1;
}

if (param != I8042_RET_CTL_TEST) {
printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
param, I8042_RET_CTL_TEST);
return -1;
}

return 0;
}

/*
* i8042_controller init initializes the i8042 controller, and,
Expand All @@ -719,21 +739,8 @@ static int i8042_controller_init(void)
return -1;
}

if (i8042_reset) {

unsigned char param;

if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
return -1;
}

if (param != I8042_RET_CTL_TEST) {
printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
param, I8042_RET_CTL_TEST);
return -1;
}
}
if (i8042_ctl_test())
return -1;

/*
* Save the CTR for restoral on unload / reboot.
Expand Down Expand Up @@ -806,9 +813,7 @@ static void i8042_controller_reset(void)
* Reset the controller if requested.
*/

if (i8042_reset)
if (i8042_command(&param, I8042_CMD_CTL_TEST))
printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
i8042_ctl_test();

/*
* Disable MUX mode if present.
Expand Down Expand Up @@ -920,8 +925,11 @@ static int i8042_resume(struct device *dev, u32 level)
if (level != RESUME_ENABLE)
return 0;

if (i8042_controller_init()) {
printk(KERN_ERR "i8042: resume failed\n");
if (i8042_ctl_test())
return -1;

if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
printk(KERN_ERR "i8042: Can't write CTR\n");
return -1;
}

Expand Down

0 comments on commit 96e9fc8

Please sign in to comment.