Input: trackpoint - force 3 buttons if 0 button is reported
Subsystems (2)
PATCH 1/1 Input: trackpoint - force 3 buttons if 0 button is reported
Lenovo introduced trackpoint compatible sticks with minimum PS/2 commands. Some of these sticks with 3 buttons always return 0 when reading extended button info, set it as 3 buttons to enable middle button.
--- drivers/input/mouse/trackpoint.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/input/mouse/trackpoint.c +4 -0
@@ -383,6 +383,10 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)if (trackpoint_read (ps2dev,TP_EXT_BTN , &button_info)) {psmouse_warn (psmouse,"failed to get extended button data, assuming 3 buttons\n" ); button_info =0x33 ; + }else if (!button_info) { +psmouse_warn (psmouse, +"got no extended button data, assuming 3 buttons\n" ); + button_info =0x33 ; } psmouse->private =kzalloc (sizeof (struct trackpoint_data ),GFP_KERNEL );
Signature · 1 line
2.14.3
Dmitry Torokhov
maintainerQuoted 3 lines · Aaron Ma
Lenovo introduced trackpoint compatible sticks with minimum PS/2 commands. Some of these sticks with 3 buttons always return 0 when reading extended button info, set it as 3 buttons to enable middle button.
Does it only happen with newer ELan/ALPS/NXP trackpoints, or also with trackpoints advertising the original 0x010E version? What devices respond with 0 as button info?
Quoted 25 lines
Signed-off-by Aaron Ma <[email protected]>--- drivers/input/mouse/trackpoint.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/input/mouse/trackpoint.c +4
-0@@ -383,6 +383,10 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)if (trackpoint_read (ps2dev,TP_EXT_BTN , &button_info)) {psmouse_warn (psmouse,"failed to get extended button data, assuming 3 buttons\n" ); button_info =0x33 ; + }else if (!button_info) { +psmouse_warn (psmouse, +"got no extended button data, assuming 3 buttons\n" ); + button_info =0x33 ; } psmouse->private =kzalloc (sizeof (struct trackpoint_data ),GFP_KERNEL );Signature · 1 line
2.14.3
Signature · 1 line
Dmitry
Only this laptop had been confirmed is ALPS: 0102 – FF02 trackpoint, it return 0 of extended button.
I saw the other device that returned 0, but don't have it now, so the ID can not be checked.
ThinkPad always have 3 buttons installed, I suggest always set 0x33 for button info when the button info returned 0.
Dmitry Torokhov
maintainerHi Aaron,
Quoted 7 lines · Aaron Ma
Only this laptop had been confirmed is ALPS: 0102 – FF02 trackpoint, it return 0 of extended button.
I saw the other device that returned 0, but don't have it now, so the ID can not be checked.ThinkPad always have 3 buttons installed, I suggest always set
0x33for button info when the button info returned 0.
I am really uncomfortable at us chipping away all validations in trackpont protocol. The newer trackpoints (Elan, ALPS, etc) will be taken care of with my patch that will not even try to fetch extended button data for 0x02 - 0x04 extended ID devices, but unless we have a concrete example of 0x01 responding with 0 for button info I will not apply this patch.
Thanks.
Signature · 1 line
Dmitry
Will your patch go to stable kernel?
If yes, that's fine.
Dmitry Torokhov
maintainerQuoted 2 lines · Aaron Ma
Will your patch go to stable kernel?
If yes, that's fine.
Hmm, it looks like we need this patch after all as we do have screwy Lenovos with apparently 0x01 devices reporting 0 buttons. From
https://bugzilla.kernel.org/show_bug.cgi?id=196253
thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown
thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGE
psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 0/0
I'll ask them to try my patch and if it is indeed 0x01 device I'll apply your patch.
Thanks.
Signature · 1 line
Dmitry
On Tue, Jan 16, 2018 at 03:07:13PM -0800, Dmitry Torokhov wrote:
Hi Dmitry,
Quoted 9 lines · Aaron Ma
Quoted 2 lines
Will your patch go to stable kernel?
If yes, that's fine.Hmm, it looks like we need this patch after all as we do have screwy Lenovos with apparently
0x01devices reporting 0 buttons. From
https://bugzilla.kernel.org/show_bug.cgi?id=196253
Quoted 7 lines
thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown
thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGEpsmouse serio2: trackpoint: IBM TrackPoint firmware:
0x0e, buttons: 0/0I'll ask them to try my patch and if it is indeed
0x01device I'll apply your patch.
It is quite strange. In the past,for commit 293b915fd9be
"Input: trackpoint - assume 3 buttons when buttons detection fails" there was success reported for lenovo e470 and I see the same success report in that bugzilla ticket. I can also report success on lenovo e570.
But some seem to have problems, could it be that they are not including that commit in the kernel they are running ? Or did a bios upgrade change the behaviour ?
It would be best when we have a confirmation from a e470 owner that without the proposed patch from Aaron the middle button does not work on his e470, and it works with it.
Kind regards,
Ulrik
Dmitry Torokhov
maintainerQuoted 29 lines · On January 21, 2018 12:10:50 PM PST, [email protected] wrote:
On Tue, Jan 16, 2018 at 03:07:13PM -0800, Dmitry Torokhov wrote:
Hi Dmitry,Quoted 13 lines · Aaron Ma
Quoted 2 lines
Will your patch go to stable kernel?
If yes, that's fine.Hmm, it looks like we need this patch after all as we do have screwy Lenovos with apparently
0x01devices reporting 0 buttons. From
https://bugzilla.kernel.org/show_bug.cgi?id=196253
thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown
thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGEpsmouse serio2: trackpoint: IBM TrackPoint firmware:
0x0e, buttons:0/0
Quoted 2 lines
I'll ask them to try my patch and if it is indeed
0x01device I'llapply
Quoted 1 line
your patch.
It is quite strange. In the past,for commit
293b915fd9be"Input: trackpoint - assume 3 buttons when buttons detection fails" there was
success reported for lenovo e470 and I see the same success report in that
bugzilla ticket. I can also report success on lenovo e570.
Quoted 10 lines
But some seem to have problems, could it be that they are not including that
commit in the kernel they are running ? Or did a bios upgrade change the
behaviour ?
It would be best when we have a confirmation from a e470 owner that without the
proposed patch from Aaron the middle button does not work on his e470, and it
works with it.
I suppose Lenovo changed the firmware, because if you take a look at bugzilla link I provided there is a box that does not fail the command but indeed responds with 0 as number of buttons. It still reports device ID 0x010e.
Hi Ulrik,
Thanks.
Signature · 1 line
Dmitry