aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@pond.sub.org>2007-07-18 01:20:41 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-07-18 01:20:41 -0400
commit018db6bb0d726c3683a5e1eb4621e728965db94c (patch)
treeecaca2bab01ab4bb56f74975732a91e421cd86fc /drivers/input
parent20b3cdd6773be09f7bf52113de0d0c37da287f29 (diff)
Input: i8042 - restore control register when enabling port fails
When enabling interrupts for a port fails, the interrupt enable and port enable bits remain set in i8042_ctr. Later writes of i8042_ctr to the hardware could accidentally retry enabling interrupts. Clear the bits on failure. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/serio/i8042.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 3888dc307e0c..42aa4ec72661 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -385,6 +385,8 @@ static int i8042_enable_kbd_port(void)
385 i8042_ctr |= I8042_CTR_KBDINT; 385 i8042_ctr |= I8042_CTR_KBDINT;
386 386
387 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { 387 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
388 i8042_ctr &= ~I8042_CTR_KBDINT;
389 i8042_ctr |= I8042_CTR_KBDDIS;
388 printk(KERN_ERR "i8042.c: Failed to enable KBD port.\n"); 390 printk(KERN_ERR "i8042.c: Failed to enable KBD port.\n");
389 return -EIO; 391 return -EIO;
390 } 392 }
@@ -402,6 +404,8 @@ static int i8042_enable_aux_port(void)
402 i8042_ctr |= I8042_CTR_AUXINT; 404 i8042_ctr |= I8042_CTR_AUXINT;
403 405
404 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { 406 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
407 i8042_ctr &= ~I8042_CTR_AUXINT;
408 i8042_ctr |= I8042_CTR_AUXDIS;
405 printk(KERN_ERR "i8042.c: Failed to enable AUX port.\n"); 409 printk(KERN_ERR "i8042.c: Failed to enable AUX port.\n");
406 return -EIO; 410 return -EIO;
407 } 411 }