summaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/i8042.c
diff options
context:
space:
mode:
authorLinus Torvalds2009-04-17 19:08:13 +0200
committerLinus Torvalds2009-04-17 19:08:13 +0200
commit91ec65ba335db80b686f93b9eb531d537e712e61 (patch)
tree462ab5101fa164ad84dae8afe5e220cc91f3ff29 /drivers/input/serio/i8042.c
parentGet rid of final remnants of include/asm-$(ARCH) (diff)
parentMerge branch 'next' into for-linus (diff)
downloadkernel-qcow2-linux-91ec65ba335db80b686f93b9eb531d537e712e61.tar.gz
kernel-qcow2-linux-91ec65ba335db80b686f93b9eb531d537e712e61.tar.xz
kernel-qcow2-linux-91ec65ba335db80b686f93b9eb531d537e712e61.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: ads7846 - fix unsafe disable_irq Input: mainstone-wm97xx - fix condition in pen_up Input: pc110pad - remove unused variable dev Input: bf54x-keys - remove depreciated IRQF_SAMPLE_RANDOM flag Input: ad7877, ad7879 - remove depreciated IRQF_SAMPLE_RANDOM flag Input: da9034-ts - make pen {down,up} events more reliable Input: da9034-ts - add Bin Yang as co-author of the driver Input: atkbd - add forced release keys quirk for Samsung NC20 Input: atkbd - add forced release keys quirk for Samsung Q45 Input: gameport - fix attach driver code Input: hp_sdc_rtc should depend on serio Input: wm97xx - don't specify IRQF_SAMPLE_RANDOM Input: ads7846 - introduce platform specific way to synchronize sampling Input: remove unnecessary synchronize_rcu() call Input: i8042 - add a DMI table for the i8042.reset option Input: i8042 - introduce a tougher reset
Diffstat (limited to 'drivers/input/serio/i8042.c')
-rw-r--r--drivers/input/serio/i8042.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 170f71ee5772..3cffb704e374 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -712,22 +712,43 @@ static int i8042_controller_check(void)
static int i8042_controller_selftest(void)
{
unsigned char param;
+ int i = 0;
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 -ENODEV;
- }
+ /*
+ * We try this 5 times; on some really fragile systems this does not
+ * take the first time...
+ */
+ do {
+
+ if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
+ printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
+ return -ENODEV;
+ }
+
+ if (param == I8042_RET_CTL_TEST)
+ return 0;
- if (param != I8042_RET_CTL_TEST) {
printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
- param, I8042_RET_CTL_TEST);
- return -EIO;
- }
+ param, I8042_RET_CTL_TEST);
+ msleep(50);
+ } while (i++ < 5);
+#ifdef CONFIG_X86
+ /*
+ * On x86, we don't fail entire i8042 initialization if controller
+ * reset fails in hopes that keyboard port will still be functional
+ * and user will still get a working keyboard. This is especially
+ * important on netbooks. On other arches we trust hardware more.
+ */
+ printk(KERN_INFO
+ "i8042: giving up on controller selftest, continuing anyway...\n");
return 0;
+#else
+ return -EIO;
+#endif
}
/*