diff mbox series

The alps i8042 trackstick doesn't work on a latest Lenovo laptop

Message ID 305b3772-8441-adb1-93df-8fb629fbf1a9@canonical.com (mailing list archive)
State New, archived
Headers show
Series The alps i8042 trackstick doesn't work on a latest Lenovo laptop | expand

Commit Message

Hui Wang April 17, 2019, 12:37 p.m. UTC
Hello Masaki,

Recently I worked on a latest lenovo laptop, but found the trackstick 
and 3 buttons on top of the trackpad can't work with the latest linux 
kernel. But the trackpad worked well. On this machine the trackpad is is 
connected to an i2c synaptics controller while the trackstick and 3 
buttons are connected to an i8042 alps controller. When I touch the 
trackstick or 3 buttons, the linux kernel will print "Rejected 
trackstick packet from non DualPoint device".

I enabled the debug on psmouse.ko, then the kernel print:

[    4.122673] psmouse serio1: alps: E6 report: 00 00 64
[    4.146342] psmouse serio1: alps: E7 report: 73 03 28
[    4.169612] psmouse serio1: alps: EC report: 73 01 03

I noticed that you wrote a patch for a similar issue: 567b9b549cfa 
(Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 
7370), then I printed out the content of otp[][], they are all 0x00,  so 
it looks like there is no "PS2 interface Firmware setting" in this i8042 
alps controller too. And when reading the register 0xD7, it returns 0x3D 
rather than 0x0C or 0x1D, so I put the 0x3D in the code like below:

                 input_report_key(dev2, BTN_LEFT, f->ts_left);

u@u-ThinkPad:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:    Sleep Button
/dev/input/event1:    Lid Switch
/dev/input/event2:    Power Button
/dev/input/event3:    AT Translated Set 2 keyboard
/dev/input/event4:    Wacom Pen and multitouch sensor Finger
/dev/input/event5:    Wacom Pen and multitouch sensor Pen
/dev/input/event6:    Video Bus
/dev/input/event7:    AlpsPS/2 ALPS DualPoint Stick
/dev/input/event8:    AlpsPS/2 ALPS DualPoint TouchPad
/dev/input/event9:    Intel HID events
/dev/input/event10:    Integrated Camera: Integrated C
/dev/input/event11:    ThinkPad Extra Buttons
/dev/input/event12:    SYNA8004:00 06CB:CD8B Touchpad
/dev/input/event13:    HDA Intel PCH Mic
/dev/input/event14:    HDA Intel PCH Headphone
/dev/input/event15:    HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event16:    HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event17:    HDA Intel PCH HDMI/DP,pcm=8
/dev/input/event18:    HDA Intel PCH HDMI/DP,pcm=9
/dev/input/event19:    HDA Intel PCH HDMI/DP,pcm=10
Select the device event number [0-19]: 7
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x2 product 0x8 version 0x800
Input device name: "AlpsPS/2 ALPS DualPoint Stick"
Supported events:
   Event type 0 (EV_SYN)
   Event type 1 (EV_KEY)
     Event code 272 (BTN_LEFT)
     Event code 273 (BTN_RIGHT)
     Event code 274 (BTN_MIDDLE)
   Event type 2 (EV_REL)
     Event code 0 (REL_X)
     Event code 1 (REL_Y)
   Event type 3 (EV_ABS)
     Event code 24 (ABS_PRESSURE)
       Value      0
       Min        0
       Max      127
Properties:
   Property type 0 (INPUT_PROP_POINTER)
   Property type 5 (INPUT_PROP_POINTING_STICK)
Testing ... (interrupt to exit)
Event: time 1555485544.948547, type 2 (EV_REL), code 0 (REL_X), value 15
Event: time 1555485544.948547, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485544.948547, type 3 (EV_ABS), code 24 (ABS_PRESSURE), 
value 3
Event: time 1555485544.948547, -------------- SYN_REPORT ------------
Event: time 1555485544.956929, type 2 (EV_REL), code 0 (REL_X), value 15
Event: time 1555485544.956929, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485544.956929, -------------- SYN_REPORT ------------
Event: time 1555485544.966070, type 2 (EV_REL), code 0 (REL_X), value 16
Event: time 1555485544.966070, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485544.966070, -------------- SYN_REPORT ------------
Event: time 1555485544.974722, type 2 (EV_REL), code 0 (REL_X), value 16
Event: time 1555485544.974722, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485544.974722, -------------- SYN_REPORT ------------
Event: time 1555485544.984756, type 2 (EV_REL), code 0 (REL_X), value 17
Event: time 1555485544.984756, type 2 (EV_REL), code 1 (REL_Y), value -3
Event: time 1555485544.984756, -------------- SYN_REPORT ------------
Event: time 1555485544.994990, type 2 (EV_REL), code 0 (REL_X), value 17
Event: time 1555485544.994990, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485544.994990, -------------- SYN_REPORT ------------
Event: time 1555485545.005373, type 2 (EV_REL), code 0 (REL_X), value 19
Event: time 1555485545.005373, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485545.005373, type 3 (EV_ABS), code 24 (ABS_PRESSURE), 
value 2
Event: time 1555485545.005373, -------------- SYN_REPORT ------------
Event: time 1555485545.015056, type 2 (EV_REL), code 0 (REL_X), value 19
Event: time 1555485545.015056, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485545.015056, -------------- SYN_REPORT ------------
Event: time 1555485545.024815, type 2 (EV_REL), code 0 (REL_X), value 20
Event: time 1555485545.024815, type 2 (EV_REL), code 1 (REL_Y), value -2
Event: time 1555485545.024815, -------------- SYN_REPORT ------------
Event: time 1555485545.034701, type 2 (EV_REL), code 0 (REL_X), value 19
Event: time 1555485545.034701, type 2 (EV_REL), code 1 (REL_Y), value -3
Event: time 1555485545.034701, type 3 (EV_ABS), code 24 (ABS_PRESSURE), 
value 3


Thanks,

Hui.
diff mbox series

Patch

--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -2568,7 +2568,7 @@  static int alps_update_dual_info_ss4_v2(unsigned 
char otp[][4],
                         alps_exit_command_mode(psmouse);
                         ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);

-                       if (reg_val == 0x0C || reg_val == 0x1D)
+                       if (reg_val == 0x0C || reg_val == 0x1D || 
reg_val == 0x3D)
                                 is_dual = true;
                 }
         }

After that, the 3 buttons worked well, and the trackstick basically 
worked. Basically work here means when I move trackstick, the cursor can 
move, but the cursor moves very fast, it doesn't like the trackpad which 
moves smoothly. If I run sudo evtest on other tracksticks or trackpads, 
they basically report +1 or -1 for rel_x or rel_y, but on this alps 
trackstick, it reports 10+ for rel_x or rel_y usually (evtest log is 
pasted at the end of this email),  If I did some hack in the code like 
below, the trackstick can move smoothly too, but it is really a ugly 
hack. Do you have any idea why it moves so fast? Is it has something to 
do with the "PS2 interface Firmware setting" too?

--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1362,8 +1362,8 @@  static void alps_process_packet_ss4_v2(struct 
psmouse *psmouse)
                         return;
                 }

-               input_report_rel(dev2, REL_X, SS4_TS_X_V2(packet));
-               input_report_rel(dev2, REL_Y, SS4_TS_Y_V2(packet));
+               input_report_rel(dev2, REL_X, SS4_TS_X_V2(packet)/16);
+               input_report_rel(dev2, REL_Y, SS4_TS_Y_V2(packet)/16);
                 input_report_abs(dev2, ABS_PRESSURE, SS4_TS_Z_V2(packet));