Skip to contentSkip to conversation

synaptics: Add min/max quirk for ThinkPad T431s, L440, L540, Yoga and X1

PATCH New Hans de Goede 2 participants 5 messages Apr 17, 2014 – Apr 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover synaptics: Add min/max quirk for ThinkPad T431s, L440, L540, Yoga and X1

Hi All,

And the quirks keep coming in <sigh> so here is a v3. Changelog:

v2:
-Add Cc: [email protected]

v3:
-Add a quirk for the L540
-Standardized S1 Yoga and X1 values, Yoga uses the same touchpad as the
X240, X1 uses the same touchpad as the T440

Regards,

Hans

#1 lore raw

PATCH v3 1/1 synaptics: Add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1

We expect that all the Haswell series will need such quirks, sigh.

The T431s seems to be T430 hardware in a T440s case, using the T440s touchpad, with the same min/max issue.

The X1 Carbon 3rd generation name says 2nd while it is a 3rd generation.

The X1 and T431s share a PnPID with the T540p, but the reported ranges are closer to those of the T440s.

HdG: Squashed 5 quirk patches into one. T431s + L440 + L540 are written by me, S1 Yoga and X1 are written by Benjamin Tissoires.

Hdg: Standardized S1 Yoga and X1 values, Yoga uses the same touchpad as the X240, X1 uses the same touchpad as the T440.

---
 drivers/input/mouse/synaptics.c | 42 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
drivers/input/mouse/synaptics.c +42 -0
index a8b57d7..7c9f509 100644
@@ -1566,6 +1566,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
 		.driver_data = (int []){1232, 5710, 1156, 4696},
 	},
 	{
+		/* Lenovo ThinkPad T431s */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T431"),
+		},
+		.driver_data = (int []){1024, 5112, 2024, 4832},
+	},
+	{
 		/* Lenovo ThinkPad T440s */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
@@ -1574,6 +1582,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
 		.driver_data = (int []){1024, 5112, 2024, 4832},
 	},
 	{
+		/* Lenovo ThinkPad L440 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L440"),
+		},
+		.driver_data = (int []){1024, 5112, 2024, 4832},
+	},
+	{
 		/* Lenovo ThinkPad T540p */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
@@ -1581,6 +1597,32 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
 		},
 		.driver_data = (int []){1024, 5056, 2058, 4832},
 	},
+	{
+		/* Lenovo ThinkPad L540 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L540"),
+		},
+		.driver_data = (int []){1024, 5112, 2024, 4832},
+	},
+	{
+		/* Lenovo Yoga S1 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
+					"ThinkPad S1 Yoga"),
+		},
+		.driver_data = (int []){1232, 5710, 1156, 4696},
+	},
+	{
+		/* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION,
+					"ThinkPad X1 Carbon 2nd"),
+		},
+		.driver_data = (int []){1024, 5112, 2024, 4832},
+	},
 #endif
 	{ }
 };
Signature · 1 line
1.9.0
maintainer
#2 lore raw

Re: [PATCH v3] synaptics: Add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1

Hi Hans,

Quoted 1 line · Hans de Goede

We expect that all the Haswell series will need such quirks, sigh.

Given this statement do we really want this to be handled in kernel? Maybe we simply want udev to fix up the limits with EVIOSABS(), similarly to how we adjust keymaps for laptops?

Thanks.

Signature · 1 line
Dmitry
#3 lore raw

Re: [PATCH v3] synaptics: Add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1

Hi,

Quoted 6 lines · Dmitry Torokhov

Hi Hans,

Quoted 1 line · Hans de Goede

We expect that all the Haswell series will need such quirks, sigh.

Given this statement do we really want this to be handled in kernel?

I know this answer won't make you happy, but short term: Yes, we are getting many many bugreports about this, ie:

https://bugzilla.redhat.com/show_bug.cgi?id=1060885
https://bugzilla.redhat.com/show_bug.cgi?id=1068716
https://bugzilla.redhat.com/show_bug.cgi?id=1085582
https://bugzilla.redhat.com/show_bug.cgi?id=1085697
https://bugzilla.redhat.com/show_bug.cgi?id=1086227

And by extending the *already present* quirk table we can get this issue resolved quickly, and also resolve it for people running older kernels through the various stable series.

Quoted 1 line

Maybe we simply want udev to fix up the limits with EVIOSABS(),

Ah, I did not know that it is possible to fixup the min/max values from user space, that is good to know.

Quoted 1 line

similarly to how we adjust keymaps for laptops?

We're currently looking into various ways to make this less painful, specifically for most laptops the problem seems to be the min value and not the max value. And the troublesome min value is the synaptics driver default, not the one we get from the firmware. The problem is we never ask the firmware because even though it has the "I can report min values" capability bit, its "maximum understood request" number is too low, so one of our 2 checks for getting the min value is failing. If we remove that check some models do give us a proper range (but not all, ie the T440s is still wrong).

We're currently trying to figure out if it will be safe for all models to remove the "maximum understood request" number check. That should ie remove the quirk for the x240 and possible others.

An other option to make this better is to switch the quirks to using pnp-ids, ie the L440 and L540 share the same pnp-id. Once you've merged the firmware_id patches I can take a shot at simplifying the quirk table that way. Downside is that we then probably need to put the firmware_id patches in the various stable kernels.

Note that even if we end up moving this to userspace, then we still need the firmware_id, because I believe any userspace solution should be using pnp-ids too.

TL;DR: It is complicated and for now we would like to continue with the quirks as we've done sofar. We are aware that this is undesirable from a maintenance pov and are looking into making this better.

Regards,

Hans

maintainer
#4 lore raw

Re: [PATCH v3] synaptics: Add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1

Quoted 50 lines · Hans de Goede

Hi,

Quoted 6 lines · Dmitry Torokhov

Hi Hans,

Quoted 1 line · Hans de Goede

We expect that all the Haswell series will need such quirks, sigh.

Given this statement do we really want this to be handled in kernel?

I know this answer won't make you happy, but short term: Yes, we are getting many many bugreports about this, ie:

https://bugzilla.redhat.com/show_bug.cgi?id=1060885
https://bugzilla.redhat.com/show_bug.cgi?id=1068716
https://bugzilla.redhat.com/show_bug.cgi?id=1085582
https://bugzilla.redhat.com/show_bug.cgi?id=1085697
https://bugzilla.redhat.com/show_bug.cgi?id=1086227

And by extending the *already present* quirk table we can get this issue resolved quickly, and also resolve it for people running older kernels through the various stable series.

Quoted 1 line

Maybe we simply want udev to fix up the limits with EVIOSABS(),

Ah, I did not know that it is possible to fixup the min/max values from user space, that is good to know.

Quoted 1 line

similarly to how we adjust keymaps for laptops?

We're currently looking into various ways to make this less painful, specifically for most laptops the problem seems to be the min value and not the max value. And the troublesome min value is the synaptics driver default, not the one we get from the firmware. The problem is we never ask the firmware because even though it has the "I can report min values" capability bit, its "maximum understood request" number is too low, so one of our 2 checks for getting the min value is failing. If we remove that check some models do give us a proper range (but not all, ie the T440s is still wrong).

We're currently trying to figure out if it will be safe for all models to remove the "maximum understood request" number check. That should ie remove the quirk for the x240 and possible others.

An other option to make this better is to switch the quirks to using pnp-ids, ie the L440 and L540 share the same pnp-id. Once you've merged the firmware_id patches I can take a shot at simplifying the quirk table that way. Downside is that we then probably need to put the firmware_id patches in the various stable kernels.

Quoted 7 lines

Note that even if we end up moving this to userspace, then we still need the firmware_id, because I believe any userspace solution should be using pnp-ids too.

TL;DR: It is complicated and for now we would like to continue with the quirks as we've done sofar. We are aware that this is undesirable from a maintenance pov and are looking into making this better.

OK, fair enough. I applied the patch.

Thanks.

Signature · 1 line
Dmitry