* [PATCH 1/1] Elantech touchpad detection fix for laptops
@ 2014-12-24 0:17 Srihari Vijayaraghavan
2015-01-05 8:45 ` Srihari Vijayaraghavan
0 siblings, 1 reply; 8+ messages in thread
From: Srihari Vijayaraghavan @ 2014-12-24 0:17 UTC (permalink / raw)
To: linux-input
Cc: Dmitry Torokhov, Mateusz Jończyk, Zakariya Dehlawi,
linux-kernel
Hello Folks,
[Thanks for Dmitry for pointing out my error in previous attempts at
sending this email. I've fixed it now. Sorry if you've received this
email multiple times by now.]
Months ago, I raised kernel bugzilla 81331
(https://bugzilla.kernel.org/show_bug.cgi?id=81331) for Linux not
detecting my Elantech touchpad from a cold boot. As can be seen in
that bug report, besides myself, it's indeed affecting a number of
other users.
Since then, based on the original patch fix given by Mateusz Jonczyk,
I've extended it to be this (which not only fixes my problem, but
others as well) & would appreciate your review (and inputs thereof) &
if you're happy with it, then request you to kindly merge it upstream
on mainline & stable.
On behalf of all affected users, much appreciate your help in this
matter. Thank you.
PS: If gmail somehow spoils this patch when it comes through, then
please refer to the above kernel bugzilla URL, where the same patch is
available as a file attachment.
diff --git a/Documentation/kernel-parameters.txt
b/Documentation/kernel-parameters.txt
index 479f332..5ae99f3 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1270,6 +1270,7 @@ bytes respectively. Such letter suffixes can
also be entirely omitted.
i8042.notimeout [HW] Ignore timeout condition signalled by controller
i8042.reset [HW] Reset the controller during init and cleanup
i8042.unlock [HW] Unlock (ignore) the keylock
+ i8042.kbdreset [HW] Reset keyboard to detect Elantech touchpad
i810= [HW,DRM]
diff --git a/drivers/input/serio/i8042-x86ia64io.h
b/drivers/input/serio/i8042-x86ia64io.h
index faeeb13..40e85ed 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -735,6 +735,29 @@ static const struct dmi_system_id __initconst
i8042_dmi_dritek_table[] = {
{ }
};
+/*
+ * Just as per kernel bugzilla #81331, some Elantech touchpad based laptops
+ * -- e.g., Gigabyte P35 v2, Gigabyte X3 Plus -- need keyboard reset while
+ * probing for the touchpad to get detected, initialised & finally work.
+ */
+static const struct dmi_system_id __initconst
i8042_dmi_elantech_kbdreset_table[] = {
+ {
+ /* Gigabyte P35 v2 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
+ },
+ },
+ {
+ /* Aorus branded Gigabyte X3 Plus */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
+ },
+ },
+ { }
+};
+
#endif /* CONFIG_X86 */
#ifdef CONFIG_PNP
@@ -1030,6 +1053,9 @@ static int __init i8042_platform_init(void)
if (dmi_check_system(i8042_dmi_dritek_table))
i8042_dritek = true;
+ if (dmi_check_system(i8042_dmi_elantech_kbdreset_table))
+ i8042_kbdreset = true;
+
/*
* A20 was already enabled during early kernel init. But some buggy
* 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 f5a98af..7cf42df 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -67,6 +67,10 @@ static bool i8042_notimeout;
module_param_named(notimeout, i8042_notimeout, bool, 0);
MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
+static bool i8042_kbdreset;
+module_param_named(kbdreset, i8042_kbdreset, bool, 0);
+MODULE_PARM_DESC(kbdreset, "Reset keyboard to detect Elantech
touchpad on some laptops");
+
#ifdef CONFIG_X86
static bool i8042_dritek;
module_param_named(dritek, i8042_dritek, bool, 0);
@@ -790,6 +794,14 @@ static int __init i8042_check_aux(void)
return -1;
/*
+ * Reset keyboard to detect touchpad on some laptops having Elantech touchpad
+ */
+ if (i8042_kbdreset) {
+ pr_warn("Resetting keyboard to detect Elantech
touchpad on some laptops\n");
+ i8042_kbd_write(NULL, (unsigned char) 0xff);
+ }
+
+/*
* Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and
* used it for a PCI card or somethig else.
*/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2014-12-24 0:17 [PATCH 1/1] Elantech touchpad detection fix for laptops Srihari Vijayaraghavan
@ 2015-01-05 8:45 ` Srihari Vijayaraghavan
2015-01-07 7:44 ` Dmitry Torokhov
0 siblings, 1 reply; 8+ messages in thread
From: Srihari Vijayaraghavan @ 2015-01-05 8:45 UTC (permalink / raw)
To: linux-input, Dmitry Torokhov
Cc: Mateusz Jończyk, Zakariya Dehlawi, guillaum.bouchard
[-- Attachment #1: Type: text/plain, Size: 570 bytes --]
Hello Folks & Dmitry,
Further to the previous patch, here is the current version (against
mainline) updated with the DMI info of another laptop model where this
fix had helped a user.
Can you please review it & give some feedback? If it looks good as it
is, then on behalf of all affected users (including yours truly), may
I request for it to be merged upstream (and possibly stable too)?
(If the patch gets spoiled by gmail, please ref to this bugzilla URL,
where this patch is there as a file attachment:
https://bugzilla.kernel.org/show_bug.cgi?id=81331)
Thanks
[-- Attachment #2: elantech_touchpad_fix_for_laptops_v4_against_mainline.patch --]
[-- Type: text/x-patch, Size: 4088 bytes --]
commit c77a39a799b51fbb68b72330267c2d32a8e20542
Author: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com>
Date: Mon Jan 5 18:53:04 2015 +1100
As reported in kernel bugzilla 81331, on many laptops keyboard needs to be reset
for the detection of Elantech touchpad. Based on the original patch by Mateusz Jończyk
this version has been expanded to include DMI based detection & application of the fix
automatically. Confirmed to fix the problem by three users already.
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>
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 4df73da..c6e8cbc 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1277,6 +1277,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
i8042.notimeout [HW] Ignore timeout condition signalled by controller
i8042.reset [HW] Reset the controller during init and cleanup
i8042.unlock [HW] Unlock (ignore) the keylock
+ i8042.kbdreset [HW] Reset keyboard to detect Elantech touchpad
i810= [HW,DRM]
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index c66d1b5..734360b 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -745,6 +745,36 @@ static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
{ }
};
+/*
+ * Just as per kernel bugzilla #81331, some Elantech touchpad based laptops
+ * need keyboard reset while probing for the tochpad to get detected,
+ * initialised & finally work.
+ */
+static const struct dmi_system_id __initconst i8042_dmi_elantech_kbdreset_table[] = {
+ {
+ /* Gigabyte P35 v2 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
+ },
+ },
+ {
+ /* Aorus branded Gigabyte X3 Plus */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
+ },
+ },
+ {
+ /* Gigabyte P34 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
+ },
+ },
+ { }
+};
+
#endif /* CONFIG_X86 */
#ifdef CONFIG_PNP
@@ -1040,6 +1070,9 @@ static int __init i8042_platform_init(void)
if (dmi_check_system(i8042_dmi_dritek_table))
i8042_dritek = true;
+ if (dmi_check_system(i8042_dmi_elantech_kbdreset_table))
+ i8042_kbdreset = true;
+
/*
* A20 was already enabled during early kernel init. But some buggy
* 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 924e4bf..92d0aa8 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -67,6 +67,10 @@ static bool i8042_notimeout;
module_param_named(notimeout, i8042_notimeout, bool, 0);
MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
+static bool i8042_kbdreset;
+module_param_named(kbdreset, i8042_kbdreset, bool, 0);
+MODULE_PARM_DESC(kbdreset, "Reset keyboard to detect Elantech touchpad on some laptops");
+
#ifdef CONFIG_X86
static bool i8042_dritek;
module_param_named(dritek, i8042_dritek, bool, 0);
@@ -790,6 +794,14 @@ static int __init i8042_check_aux(void)
return -1;
/*
+ * Reset keyboard to detect touchpad on some laptops having Elantech touchpad
+ */
+ if (i8042_kbdreset) {
+ pr_warn("Resetting keyboard to detect Elantech touchpad on some laptops\n");
+ i8042_kbd_write(NULL, (unsigned char) 0xff);
+ }
+
+/*
* Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and
* used it for a PCI card or somethig else.
*/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2015-01-05 8:45 ` Srihari Vijayaraghavan
@ 2015-01-07 7:44 ` Dmitry Torokhov
2015-01-07 8:23 ` Srihari Vijayaraghavan
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2015-01-07 7:44 UTC (permalink / raw)
To: Srihari Vijayaraghavan
Cc: linux-input, Mateusz Jończyk, Zakariya Dehlawi,
guillaum.bouchard
Hi Srihari,
On Mon, Jan 05, 2015 at 07:45:39PM +1100, Srihari Vijayaraghavan wrote:
> Hello Folks & Dmitry,
>
> Further to the previous patch, here is the current version (against
> mainline) updated with the DMI info of another laptop model where this
> fix had helped a user.
>
> Can you please review it & give some feedback? If it looks good as it
> is, then on behalf of all affected users (including yours truly), may
> I request for it to be merged upstream (and possibly stable too)?
>
> (If the patch gets spoiled by gmail, please ref to this bugzilla URL,
> where this patch is there as a file attachment:
> https://bugzilla.kernel.org/show_bug.cgi?id=81331)
I am not terribly happy with having fiddling with keyboard from i8042
core, but I guess that's what we have to do unless someone has better
idea...
I'll drop mention of Elantech from the option though as it may well be
needed for other devices in the future.
Thanks!
>
> Thanks
> commit c77a39a799b51fbb68b72330267c2d32a8e20542
> Author: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com>
> Date: Mon Jan 5 18:53:04 2015 +1100
>
> As reported in kernel bugzilla 81331, on many laptops keyboard needs to be reset
> for the detection of Elantech touchpad. Based on the original patch by Mateusz Jończyk
> this version has been expanded to include DMI based detection & application of the fix
> automatically. Confirmed to fix the problem by three users already.
>
> 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>
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 4df73da..c6e8cbc 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1277,6 +1277,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
> i8042.notimeout [HW] Ignore timeout condition signalled by controller
> i8042.reset [HW] Reset the controller during init and cleanup
> i8042.unlock [HW] Unlock (ignore) the keylock
> + i8042.kbdreset [HW] Reset keyboard to detect Elantech touchpad
>
> i810= [HW,DRM]
>
> diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
> index c66d1b5..734360b 100644
> --- a/drivers/input/serio/i8042-x86ia64io.h
> +++ b/drivers/input/serio/i8042-x86ia64io.h
> @@ -745,6 +745,36 @@ static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
> { }
> };
>
> +/*
> + * Just as per kernel bugzilla #81331, some Elantech touchpad based laptops
> + * need keyboard reset while probing for the tochpad to get detected,
> + * initialised & finally work.
> + */
> +static const struct dmi_system_id __initconst i8042_dmi_elantech_kbdreset_table[] = {
> + {
> + /* Gigabyte P35 v2 */
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
> + },
> + },
> + {
> + /* Aorus branded Gigabyte X3 Plus */
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
> + },
> + },
> + {
> + /* Gigabyte P34 */
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
> + },
> + },
> + { }
> +};
> +
> #endif /* CONFIG_X86 */
>
> #ifdef CONFIG_PNP
> @@ -1040,6 +1070,9 @@ static int __init i8042_platform_init(void)
> if (dmi_check_system(i8042_dmi_dritek_table))
> i8042_dritek = true;
>
> + if (dmi_check_system(i8042_dmi_elantech_kbdreset_table))
> + i8042_kbdreset = true;
> +
> /*
> * A20 was already enabled during early kernel init. But some buggy
> * 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 924e4bf..92d0aa8 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -67,6 +67,10 @@ static bool i8042_notimeout;
> module_param_named(notimeout, i8042_notimeout, bool, 0);
> MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
>
> +static bool i8042_kbdreset;
> +module_param_named(kbdreset, i8042_kbdreset, bool, 0);
> +MODULE_PARM_DESC(kbdreset, "Reset keyboard to detect Elantech touchpad on some laptops");
> +
> #ifdef CONFIG_X86
> static bool i8042_dritek;
> module_param_named(dritek, i8042_dritek, bool, 0);
> @@ -790,6 +794,14 @@ static int __init i8042_check_aux(void)
> return -1;
>
> /*
> + * Reset keyboard to detect touchpad on some laptops having Elantech touchpad
> + */
> + if (i8042_kbdreset) {
> + pr_warn("Resetting keyboard to detect Elantech touchpad on some laptops\n");
> + i8042_kbd_write(NULL, (unsigned char) 0xff);
> + }
> +
> +/*
> * Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and
> * used it for a PCI card or somethig else.
> */
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2015-01-07 7:44 ` Dmitry Torokhov
@ 2015-01-07 8:23 ` Srihari Vijayaraghavan
2015-01-07 9:11 ` Srihari Vijayaraghavan
0 siblings, 1 reply; 8+ messages in thread
From: Srihari Vijayaraghavan @ 2015-01-07 8:23 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Mateusz Jończyk, Zakariya Dehlawi,
Guillaume Bouchard
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
On 7 January 2015 at 18:44, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> Hi Srihari,
Hello Dimitry,
Thanks for your feedback. Much appreciated.
> On Mon, Jan 05, 2015 at 07:45:39PM +1100, Srihari Vijayaraghavan wrote:
>> Hello Folks & Dmitry,
>>
>> Further to the previous patch, here is the current version (against
>> mainline) updated with the DMI info of another laptop model where this
>> fix had helped a user.
>>
>> Can you please review it & give some feedback? If it looks good as it
>> is, then on behalf of all affected users (including yours truly), may
>> I request for it to be merged upstream (and possibly stable too)?
>>
>> (If the patch gets spoiled by gmail, please ref to this bugzilla URL,
>> where this patch is there as a file attachment:
>> https://bugzilla.kernel.org/show_bug.cgi?id=81331)
>
> I am not terribly happy with having fiddling with keyboard from i8042
> core, but I guess that's what we have to do unless someone has better
> idea...
Agreed 100%. Regrettably, seeing how psmouse_do_detect() doesn't even
get invoked, this heavy handed approach had to be taken at i8042 core.
However, as you've pointed out, if there is any better idea, we're all
ears.
> I'll drop mention of Elantech from the option though as it may well be
> needed for other devices in the future.
A version of the patch (against mainline) incorporating your ideas
(i.e., without too much Elantech bashing) is attached to this email
for your review.
> Thanks!
Much appreciated. Thank you.
> --
> Dmitry
Srihari Vijayaraghavan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: touchpad_detection_fix_for_laptops_v5_against_mainline.patch --]
[-- Type: text/x-patch; charset=US-ASCII; name="touchpad_detection_fix_for_laptops_v5_against_mainline.patch", Size: 4194 bytes --]
commit 567400ceed4febf53fb676dd67b1d801f901f12c
Author: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com>
Date: Wed Jan 7 19:04:21 2015 +1100
As reported in kernel bugzilla 81331, on some laptops keyboard needs to be reset
for the detection of touchpad (e.g., some Gigabyte laptop models containing Elantech)
Based on the original patch by Mateusz Jończyk this version has been expanded to include
DMI based detection & application of the fix automatically. This has been confirmed to
fix problem by three users already on three different models of laptops.
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>
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 4df73da..603fa10 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1277,6 +1277,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
i8042.notimeout [HW] Ignore timeout condition signalled by controller
i8042.reset [HW] Reset the controller during init and cleanup
i8042.unlock [HW] Unlock (ignore) the keylock
+ i8042.kbdreset [HW] Reset keyboard to detect touchpad on some laptops
i810= [HW,DRM]
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index c66d1b5..5e5edee 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[] = {
{ }
};
+/*
+ * Just as per kernel bugzilla #81331, some laptops need keyboard reset before probing
+ * for the tochpad to get it detected, initialised & finally work.
+ */
+static const struct dmi_system_id __initconst i8042_dmi_elantech_kbdreset_table[] = {
+ {
+ /* Gigabyte P35 v2 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
+ },
+ },
+ {
+ /* Aorus branded Gigabyte X3 Plus */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
+ },
+ },
+ {
+ /* Gigabyte P34 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
+ },
+ },
+ { }
+};
+
#endif /* CONFIG_X86 */
#ifdef CONFIG_PNP
@@ -1040,6 +1069,9 @@ static int __init i8042_platform_init(void)
if (dmi_check_system(i8042_dmi_dritek_table))
i8042_dritek = true;
+ if (dmi_check_system(i8042_dmi_elantech_kbdreset_table))
+ i8042_kbdreset = true;
+
/*
* A20 was already enabled during early kernel init. But some buggy
* 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 924e4bf..1a6ff74 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -67,6 +67,10 @@ static bool i8042_notimeout;
module_param_named(notimeout, i8042_notimeout, bool, 0);
MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
+static bool i8042_kbdreset;
+module_param_named(kbdreset, i8042_kbdreset, bool, 0);
+MODULE_PARM_DESC(kbdreset, "Reset keyboard to detect touchpad on some laptops");
+
#ifdef CONFIG_X86
static bool i8042_dritek;
module_param_named(dritek, i8042_dritek, bool, 0);
@@ -790,6 +794,15 @@ static int __init i8042_check_aux(void)
return -1;
/*
+ * Reset keyboard to detect touchpad on some laptops
+ * (e.g., some Gigabyte laptop models containing Elantech touchpad)
+ */
+ if (i8042_kbdreset) {
+ pr_warn("Resetting keyboard to detect touchpad on some laptops\n");
+ i8042_kbd_write(NULL, (unsigned char) 0xff);
+ }
+
+/*
* Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and
* used it for a PCI card or somethig else.
*/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2015-01-07 8:23 ` Srihari Vijayaraghavan
@ 2015-01-07 9:11 ` Srihari Vijayaraghavan
2015-01-08 1:23 ` Dmitry Torokhov
0 siblings, 1 reply; 8+ messages in thread
From: Srihari Vijayaraghavan @ 2015-01-07 9:11 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Mateusz Jończyk, Zakariya Dehlawi,
Guillaume Bouchard
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
On 7 January 2015 at 19:23, Srihari Vijayaraghavan
<linux.bug.reporting@gmail.com> wrote:
> On 7 January 2015 at 18:44, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>> Hi Srihari,
>
> Hello Dimitry,
>
> Thanks for your feedback. Much appreciated.
>
>> On Mon, Jan 05, 2015 at 07:45:39PM +1100, Srihari Vijayaraghavan wrote:
>>> Hello Folks & Dmitry,
>>>
>>> Further to the previous patch, here is the current version (against
>>> mainline) updated with the DMI info of another laptop model where this
>>> fix had helped a user.
>>>
>>> Can you please review it & give some feedback? If it looks good as it
>>> is, then on behalf of all affected users (including yours truly), may
>>> I request for it to be merged upstream (and possibly stable too)?
>>>
>>> (If the patch gets spoiled by gmail, please ref to this bugzilla URL,
>>> where this patch is there as a file attachment:
>>> https://bugzilla.kernel.org/show_bug.cgi?id=81331)
>>
>> I am not terribly happy with having fiddling with keyboard from i8042
>> core, but I guess that's what we have to do unless someone has better
>> idea...
>
> Agreed 100%. Regrettably, seeing how psmouse_do_detect() doesn't even
> get invoked, this heavy handed approach had to be taken at i8042 core.
> However, as you've pointed out, if there is any better idea, we're all
> ears.
>
>> I'll drop mention of Elantech from the option though as it may well be
>> needed for other devices in the future.
>
> A version of the patch (against mainline) incorporating your ideas
> (i.e., without too much Elantech bashing) is attached to this email
> for your review.
>
>> Thanks!
[Sorry to respond to my own email.]
Here's a better version, removing Elantech ref from the table name.
Thanks
[-- Attachment #2: touchpad_detection_fix_for_laptops_v6_against_mainline.patch --]
[-- Type: text/x-patch, Size: 4277 bytes --]
commit 2b5d814d08d4dde95c5e82b1f37bc871801038da
Author: Srihari Vijayaraghavan <linux.bug.reporting@gmail.com>
Date: Wed Jan 7 20:00:51 2015 +1100
As reported in kernel bugzilla 81331, on some laptops, keyboard needs to be
reset for the detection of touchpad (e.g., some Gigabyte laptop models
containing Elantech).
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.
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>
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 4df73da..603fa10 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1277,6 +1277,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
i8042.notimeout [HW] Ignore timeout condition signalled by controller
i8042.reset [HW] Reset the controller during init and cleanup
i8042.unlock [HW] Unlock (ignore) the keylock
+ i8042.kbdreset [HW] Reset keyboard to detect touchpad on some laptops
i810= [HW,DRM]
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index c66d1b5..3becf89 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -745,6 +745,36 @@ static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
{ }
};
+/*
+ * Some laptops need keyboard reset before probing for the trackpad to get it
+ * detected, initialised & finally work (e.g., some Gigabyte laptop models containing
+ * Elantech touchpad).
+ */
+static const struct dmi_system_id __initconst i8042_dmi_touchpad_kbdreset_table[] = {
+ {
+ /* Gigabyte P35 v2 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
+ },
+ },
+ {
+ /* Aorus branded Gigabyte X3 Plus */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
+ },
+ },
+ {
+ /* Gigabyte P34 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
+ },
+ },
+ { }
+};
+
#endif /* CONFIG_X86 */
#ifdef CONFIG_PNP
@@ -1040,6 +1070,9 @@ static int __init i8042_platform_init(void)
if (dmi_check_system(i8042_dmi_dritek_table))
i8042_dritek = true;
+ if (dmi_check_system(i8042_dmi_touchpad_kbdreset_table))
+ i8042_kbdreset = true;
+
/*
* A20 was already enabled during early kernel init. But some buggy
* 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 924e4bf..1a6ff74 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -67,6 +67,10 @@ static bool i8042_notimeout;
module_param_named(notimeout, i8042_notimeout, bool, 0);
MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
+static bool i8042_kbdreset;
+module_param_named(kbdreset, i8042_kbdreset, bool, 0);
+MODULE_PARM_DESC(kbdreset, "Reset keyboard to detect touchpad on some laptops");
+
#ifdef CONFIG_X86
static bool i8042_dritek;
module_param_named(dritek, i8042_dritek, bool, 0);
@@ -790,6 +794,15 @@ static int __init i8042_check_aux(void)
return -1;
/*
+ * Reset keyboard to detect touchpad on some laptops
+ * (e.g., some Gigabyte laptop models containing Elantech touchpad)
+ */
+ if (i8042_kbdreset) {
+ pr_warn("Resetting keyboard to detect touchpad on some laptops\n");
+ i8042_kbd_write(NULL, (unsigned char) 0xff);
+ }
+
+/*
* Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and
* used it for a PCI card or somethig else.
*/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2015-01-07 9:11 ` Srihari Vijayaraghavan
@ 2015-01-08 1:23 ` Dmitry Torokhov
2015-01-08 5:02 ` Srihari Vijayaraghavan
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2015-01-08 1:23 UTC (permalink / raw)
To: Srihari Vijayaraghavan
Cc: linux-input, Mateusz Jończyk, Zakariya Dehlawi,
Guillaume Bouchard
On Wed, Jan 07, 2015 at 08:11:36PM +1100, Srihari Vijayaraghavan wrote:
> On 7 January 2015 at 19:23, Srihari Vijayaraghavan
> <linux.bug.reporting@gmail.com> wrote:
> > On 7 January 2015 at 18:44, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> >> Hi Srihari,
> >
> > Hello Dimitry,
> >
> > Thanks for your feedback. Much appreciated.
> >
> >> On Mon, Jan 05, 2015 at 07:45:39PM +1100, Srihari Vijayaraghavan wrote:
> >>> Hello Folks & Dmitry,
> >>>
> >>> Further to the previous patch, here is the current version (against
> >>> mainline) updated with the DMI info of another laptop model where this
> >>> fix had helped a user.
> >>>
> >>> Can you please review it & give some feedback? If it looks good as it
> >>> is, then on behalf of all affected users (including yours truly), may
> >>> I request for it to be merged upstream (and possibly stable too)?
> >>>
> >>> (If the patch gets spoiled by gmail, please ref to this bugzilla URL,
> >>> where this patch is there as a file attachment:
> >>> https://bugzilla.kernel.org/show_bug.cgi?id=81331)
> >>
> >> I am not terribly happy with having fiddling with keyboard from i8042
> >> core, but I guess that's what we have to do unless someone has better
> >> idea...
> >
> > Agreed 100%. Regrettably, seeing how psmouse_do_detect() doesn't even
> > get invoked, this heavy handed approach had to be taken at i8042 core.
> > However, as you've pointed out, if there is any better idea, we're all
> > ears.
> >
> >> I'll drop mention of Elantech from the option though as it may well be
> >> needed for other devices in the future.
> >
> > A version of the patch (against mainline) incorporating your ideas
> > (i.e., without too much Elantech bashing) is attached to this email
> > for your review.
> >
> >> Thanks!
>
> [Sorry to respond to my own email.]
>
> Here's a better version, removing Elantech ref from the table name.
Applied after massaging messages some more. Thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2015-01-08 1:23 ` Dmitry Torokhov
@ 2015-01-08 5:02 ` Srihari Vijayaraghavan
2015-01-08 22:09 ` Dmitry Torokhov
0 siblings, 1 reply; 8+ messages in thread
From: Srihari Vijayaraghavan @ 2015-01-08 5:02 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, Mateusz Jończyk, Zakariya Dehlawi,
Guillaume Bouchard
On 8 January 2015 at 12:23, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Wed, Jan 07, 2015 at 08:11:36PM +1100, Srihari Vijayaraghavan wrote:
>> On 7 January 2015 at 19:23, Srihari Vijayaraghavan
>> <linux.bug.reporting@gmail.com> wrote:
>> Here's a better version, removing Elantech ref from the table name.
>
> Applied after massaging messages some more. Thank you.
Thank you Dmitry. Much appreciated. You've made a lot of affected
users very happy.
May I request you to cc stable folks when merging upstream?
Thanks
Srihari Vijayaraghavan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] Elantech touchpad detection fix for laptops
2015-01-08 5:02 ` Srihari Vijayaraghavan
@ 2015-01-08 22:09 ` Dmitry Torokhov
0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2015-01-08 22:09 UTC (permalink / raw)
To: Srihari Vijayaraghavan
Cc: linux-input, Mateusz Jończyk, Zakariya Dehlawi,
Guillaume Bouchard
On Thu, Jan 08, 2015 at 04:02:27PM +1100, Srihari Vijayaraghavan wrote:
> On 8 January 2015 at 12:23, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > On Wed, Jan 07, 2015 at 08:11:36PM +1100, Srihari Vijayaraghavan wrote:
> >> On 7 January 2015 at 19:23, Srihari Vijayaraghavan
> >> <linux.bug.reporting@gmail.com> wrote:
> >> Here's a better version, removing Elantech ref from the table name.
> >
> > Applied after massaging messages some more. Thank you.
>
> Thank you Dmitry. Much appreciated. You've made a lot of affected
> users very happy.
No, thank *you*.
>
> May I request you to cc stable folks when merging upstream?
Yes, it is marked for stable so once Linus pulls from me next time magic
should happen and it will end up in the stable kernels too.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-01-08 22:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 0:17 [PATCH 1/1] Elantech touchpad detection fix for laptops Srihari Vijayaraghavan
2015-01-05 8:45 ` Srihari Vijayaraghavan
2015-01-07 7:44 ` Dmitry Torokhov
2015-01-07 8:23 ` Srihari Vijayaraghavan
2015-01-07 9:11 ` Srihari Vijayaraghavan
2015-01-08 1:23 ` Dmitry Torokhov
2015-01-08 5:02 ` Srihari Vijayaraghavan
2015-01-08 22:09 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).