aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorSrihari Vijayaraghavan <linux.bug.reporting@gmail.com>2015-01-07 19:25:53 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-01-07 20:20:44 -0500
commit148e9a711e034e06310a8c36b64957934ebe30f2 (patch)
tree341365e3c058fd4e8bb2beb0f96891c50f1da4d9 /drivers/input
parent4f0d4fac24405098ad2f65f3f996f525e7d04703 (diff)
Input: i8042 - reset keyboard to fix Elantech touchpad detection
On some laptops, keyboard needs to be reset in order to successfully detect touchpad (e.g., some Gigabyte laptop models with Elantech touchpads). Without resettin keyboard touchpad pretends to be completely dead. Based on the original patch by Mateusz Jończyk this version has been expanded to include DMI based detection & application of the fix automatically on the affected models of laptops. This has been confirmed to fix problem by three users already on three different models of laptops. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81331 Cc: stable@vger.kernel.org Signed-off-by: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com> Acked-by: Mateusz Jończyk <mat.jonczyk@o2.pl> Tested-by: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com> Tested by: Zakariya Dehlawi <zdehlawi@gmail.com> Tested-by: Guillaum Bouchard <guillaum.bouchard@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h32
-rw-r--r--drivers/input/serio/i8042.c14
2 files changed, 46 insertions, 0 deletions
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index c66d1b53843e..97cdc58d1894 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -745,6 +745,35 @@ static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
745 { } 745 { }
746}; 746};
747 747
748/*
749 * Some laptops need keyboard reset before probing for the trackpad to get
750 * it detected, initialised & finally work.
751 */
752static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
753 {
754 /* Gigabyte P35 v2 - Elantech touchpad */
755 .matches = {
756 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
757 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
758 },
759 },
760 {
761 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
762 .matches = {
763 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
764 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
765 },
766 },
767 {
768 /* Gigabyte P34 - Elantech touchpad */
769 .matches = {
770 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
771 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
772 },
773 },
774 { }
775};
776
748#endif /* CONFIG_X86 */ 777#endif /* CONFIG_X86 */
749 778
750#ifdef CONFIG_PNP 779#ifdef CONFIG_PNP
@@ -1040,6 +1069,9 @@ static int __init i8042_platform_init(void)
1040 if (dmi_check_system(i8042_dmi_dritek_table)) 1069 if (dmi_check_system(i8042_dmi_dritek_table))
1041 i8042_dritek = true; 1070 i8042_dritek = true;
1042 1071
1072 if (dmi_check_system(i8042_dmi_kbdreset_table))
1073 i8042_kbdreset = true;
1074
1043 /* 1075 /*
1044 * A20 was already enabled during early kernel init. But some buggy 1076 * A20 was already enabled during early kernel init. But some buggy
1045 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to 1077 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index f5a98af3b325..804d2e02010a 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -67,6 +67,10 @@ static bool i8042_notimeout;
67module_param_named(notimeout, i8042_notimeout, bool, 0); 67module_param_named(notimeout, i8042_notimeout, bool, 0);
68MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042"); 68MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
69 69
70static bool i8042_kbdreset;
71module_param_named(kbdreset, i8042_kbdreset, bool, 0);
72MODULE_PARM_DESC(kbdreset, "Reset device connected to KBD port");
73
70#ifdef CONFIG_X86 74#ifdef CONFIG_X86
71static bool i8042_dritek; 75static bool i8042_dritek;
72module_param_named(dritek, i8042_dritek, bool, 0); 76module_param_named(dritek, i8042_dritek, bool, 0);
@@ -790,6 +794,16 @@ static int __init i8042_check_aux(void)
790 return -1; 794 return -1;
791 795
792/* 796/*
797 * Reset keyboard (needed on some laptops to successfully detect
798 * touchpad, e.g., some Gigabyte laptop models with Elantech
799 * touchpads).
800 */
801 if (i8042_kbdreset) {
802 pr_warn("Attempting to reset device connected to KBD port\n");
803 i8042_kbd_write(NULL, (unsigned char) 0xff);
804 }
805
806/*
793 * Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and 807 * Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and
794 * used it for a PCI card or somethig else. 808 * used it for a PCI card or somethig else.
795 */ 809 */