Skip to contentSkip to conversation

Input: elantech - enable middle button support on 2 ThinkPads

PATCH In review Aaron Ma 3 participants 7 messages May 19, 2019 – May 23, 2019

Subsystems (2)
lore
Share & tools
lore

Aaron Ma

author
#0 lore raw

PATCH 1/2 Input: elantech - enable middle button support on 2 ThinkPads

Adding 2 new touchpad PNPIDs to enable middle button support.

---
 drivers/input/mouse/elantech.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/mouse/elantech.c +2 -0
index a7f8b1614559..530142b5a115 100644
@@ -1189,6 +1189,8 @@ static const char * const middle_button_pnp_ids[] = {
 	"LEN2132", /* ThinkPad P52 */
 	"LEN2133", /* ThinkPad P72 w/ NFC */
 	"LEN2134", /* ThinkPad P72 */
+	"LEN0407",
+	"LEN0408",
 	NULL
 };
 
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/2 Input: synaptics - remove X240 from the topbuttonpad list

Lenovo ThinkPad X240 does not have the top software button. When this wrong ID in top button list, smbus mode will fail to probe, so keep it working at PS2 mode.

---
 drivers/input/mouse/synaptics.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/mouse/synaptics.c +0 -1
index b6da0c1267e3..6ae7bc92476b 100644
@@ -140,7 +140,6 @@ static const char * const topbuttonpad_pnp_ids[] = {
 	"LEN002E",
 	"LEN0033", /* Helix */
 	"LEN0034", /* T431s, L440, L540, T540, W540, X1 Carbon 2nd */
-	"LEN0035", /* X240 */
 	"LEN0036", /* T440 */
 	"LEN0037", /* X1 Carbon 2nd */
 	"LEN0038",
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH 2/2] Input: synaptics - remove X240 from the topbuttonpad list

Hi Aaron,

Quoted 15 lines · Aaron Ma

Lenovo ThinkPad X240 does not have the top software button. When this wrong ID in top button list, smbus mode will fail to probe, so keep it working at PS2 mode.

---
 drivers/input/mouse/synaptics.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/mouse/synaptics.c +0 -0
index b6da0c1267e3..6ae7bc92476b 100644

drivers/input/mouse/synaptics.c static const char * const topbuttonpad_pnp_ids[] = { · line 143

Quoted 4 lines
drivers/input/mouse/synaptics.c +0 -1
@@ -140,7 +140,6 @@ static const char * const topbuttonpad_pnp_ids[] = {
 	"LEN002E",
 	"LEN0033", /* Helix */
 	"LEN0034", /* T431s, L440, L540, T540, W540, X1 Carbon 2nd */
-	"LEN0035", /* X240 */

According to the history this came from Synaptics through Hans, so I'd like to make sure there are no several X240 versions floating around...

Quoted 6 lines
drivers/input/mouse/synaptics.c +0 -0
 	"LEN0036", /* T440 */
 	"LEN0037", /* X1 Carbon 2nd */
 	"LEN0038",
Signature · 1 line
2.17.1

Thanks.

Signature · 1 line
Dmitry
#3 lore raw

Re: [PATCH 2/2] Input: synaptics - remove X240 from the topbuttonpad list

Quoted 14 lines · Dmitry Torokhov

Hi Aaron,

Quoted 10 lines · Aaron Ma

Lenovo ThinkPad X240 does not have the top software button. When this wrong ID in top button list, smbus mode will fail to probe, so keep it working at PS2 mode.

---
 drivers/input/mouse/synaptics.c | 1 -
 1 file changed, 1 deletion(-)
Quoted 12 lines

drivers/input/mouse/synaptics.c static const char * const topbuttonpad_pnp_ids[] = { · line 143

Quoted 9 lines
drivers/input/mouse/synaptics.c +0 -1
index b6da0c1267e3..6ae7bc92476b 100644
@@ -140,7 +140,6 @@ static const char * const topbuttonpad_pnp_ids[] = {
      "LEN002E",
      "LEN0033", /* Helix */
      "LEN0034", /* T431s, L440, L540, T540, W540, X1 Carbon 2nd */
-     "LEN0035", /* X240 */

According to the history this came from Synaptics through Hans, so I'd like to make sure there are no several X240 versions floating around...

A quick google image search showed that the X240 had 2 versions: one with the top software buttons, one without.

And this definitively rings a bell. I am sure we asked Lenovo and Synaptics to change the PnPID when they would do such a change, but they "forgot" during the *40 series refresh.
We have code in place to fix the reported ranges of the coordinates, and we had to check against the board id (see min_max_pnpid_table[] in synaptics.c).
Unfortunately, X240 (LEN0035) is not part of this table, so I don't know which refresh of the board ID has implemented the non top software buttons.

Cheers,
Benjamin

Quoted 12 lines
Quoted 7 lines
drivers/input/mouse/synaptics.c +0 -1
      "LEN0036", /* T440 */
      "LEN0037", /* X1 Carbon 2nd */
      "LEN0038",
--

2.17.1

Thanks.

--
Dmitry

author
#4 lore raw

Re: [PATCH 2/2] Input: synaptics - remove X240 from the topbuttonpad list

Quoted 12 lines · Benjamin Tissoires

A quick google image search showed that the X240 had 2 versions: one with the top software buttons, one without.

And this definitively rings a bell. I am sure we asked Lenovo and Synaptics to change the PnPID when they would do such a change, but they "forgot" during the *40 series refresh.
We have code in place to fix the reported ranges of the coordinates, and we had to check against the board id (see min_max_pnpid_table[] in synaptics.c).
Unfortunately, X240 (LEN0035) is not part of this table, so I don't know which refresh of the board ID has implemented the non top software buttons.

After double confirm from Lenovo, looks like they mixed up with touchpads on X240/X240s.

For now only one user reported this LEN0035 doesn't work on SMBus mode. module parameter can be a workaround.
Maybe some touchpads with software top buttons are working well on SMBus. Let's keep eyes on this issue for now.

Regards,
Aaron

Quoted 3 lines

Cheers,
Benjamin

maintainer
#5 lore raw
In reply to Aaron Ma

Hi Aaron,

Quoted 1 line · Aaron Ma

Adding 2 new touchpad PNPIDs to enable middle button support.

Could you add their names in the comments please?

Quoted 12 lines
---
 drivers/input/mouse/elantech.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/mouse/elantech.c +0 -0
index a7f8b1614559..530142b5a115 100644

drivers/input/mouse/elantech.c static const char * const middle_button_pnp_ids[] = { · line 1193

Quoted 5 lines
drivers/input/mouse/elantech.c +2 -0
@@ -1189,6 +1189,8 @@ static const char * const middle_button_pnp_ids[] = {
 	"LEN2132", /* ThinkPad P52 */
 	"LEN2133", /* ThinkPad P72 w/ NFC */
 	"LEN2134", /* ThinkPad P72 */
+	"LEN0407",
+	"LEN0408",

These should come first - I'd like to keep the list sorted alphabetically.

Quoted 6 lines
drivers/input/mouse/elantech.c +0 -0
 	NULL
 };
 
Signature · 1 line
2.17.1

Thanks.

Signature · 1 line
Dmitry
#6 lore raw

Hi,

Quoted 15 lines · Dmitry Torokhov

Hi Aaron,

Quoted 1 line · Aaron Ma

Adding 2 new touchpad PNPIDs to enable middle button support.

Could you add their names in the comments please?

Quoted 7 lines
---
 drivers/input/mouse/elantech.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 9 lines

drivers/input/mouse/elantech.c static const char * const middle_button_pnp_ids[] = { · line 1192

Quoted 9 lines
drivers/input/mouse/elantech.c +1 -0
index a7f8b1614559..530142b5a115 100644
@@ -1189,6 +1189,8 @@ static const char * const middle_button_pnp_ids[] = {
      "LEN2132", /* ThinkPad P52 */
      "LEN2133", /* ThinkPad P72 w/ NFC */
      "LEN2134", /* ThinkPad P72 */
+     "LEN0407",

AFAICT, this one is the Lenovo P53.
However, having a whitelist of new models is not going to scale IMO.

I was thinking at submitting a patch to enable middle button unconditionally, but then I realized that libinput disables middle click emulation on touchpads with an actual physical middle button.

And this morning I just realized that we might have a better chance at this if we consider the new models to have the physical middle button. I know LEN0407 attempts to bind over SMBus, so I would think we can reduce the set of whitelist by just checking for ETP_NEW_IC_SMBUS_HOST_NOTIFY (patch coming in).

Cheers,
Benjamin

Quoted 16 lines

drivers/input/mouse/elantech.c static const char * const middle_button_pnp_ids[] = { · line 1193

Quoted 1 line
drivers/input/mouse/elantech.c +1 -0
+     "LEN0408",

These should come first - I'd like to keep the list sorted alphabetically.

Quoted 6 lines
drivers/input/mouse/elantech.c +0 -1
      NULL
 };
 
--

2.17.1

Thanks.

--
Dmitry