Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Lenovo L570 Trackpoint/Touchpad problem - partially solved
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
chl
n00b
n00b


Joined: 13 May 2003
Posts: 70
Location: Munich

PostPosted: Mon Jan 22, 2018 5:30 pm    Post subject: Lenovo L570 Trackpoint/Touchpad problem - partially solved Reply with quote

Dear All,

I have the following problem with the trackpoint/touchpad of my Lenovo L570 laptop.

According to windows the trackpoint/touchpad is an "Alps UltraNav" connected as a PS/2 device.

In my kernel config (genkernel-4.14.14) I have psmouse and Alps support enabled:
Code:
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y


When I load the psmouse module without any parameter the trackpoint/touchpad is recognized as a "AlpsPS/2 ALPS GlidePoint":
Code:
l570 chl # xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS GlidePoint                  id=15   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C           id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=16   [slave  keyboard (3)]

In that case the touchpad itself works including the touchpad functionality (like two finger scrolling, palm detection etc) but the trackpoint (the red nibble between the g, h & b keys) and the "mouse buttons" between the keyboard and the touchpad are dead.

If I load the psmouse module with the parameter proto=imps, as it is recommended on various websites, the trackpoint/touchpad is recognized as a "PS/2 Generic Mouse":
Code:
l570 chl # xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ CHESEN PS2 to USB Converter               id=11   [slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                        id=15   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C           id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=16   [slave  keyboard (3)]


In that case the trackpoint and also the "mouse buttons" are working but the touchpad functionality is gone.

Furthermore, I figured out that in the first case (loading the psmouse module without a parameter) every movement of the trackpoint and as well any click on the mouse buttons results in the following error message in the syslog:

Code:
[ 1026.448937] psmouse serio1: alps: Rejected trackstick packet from non DualPoint device


Moreover, I learned that according to the output of dmidecode the trackpoint and the touchpad seems to consist of two separate devices:

Code:
Handle 0x0031, DMI type 21, 7 bytes
Built-in Pointing Device
        Type: Track Point
        Interface: PS/2
        Buttons: 3

Handle 0x0032, DMI type 21, 7 bytes
Built-in Pointing Device
        Type: Touch Pad
        Interface: PS/2
        Buttons: 2


I also had a look at the kernel source-code - .../driver/input/mouse/alps.c. I'm not a programmer and my skills do not go beyond simple bash scripts, but what I could figure out is that the error message mentioned above is triggered if there is "input" from the trackpoint/touchpad device that does not match with the type of device detected by the psmouse module. I understand the code that combined trackpoint/touchpad devices as mine should recognized as DualPoint devices. The "AlpsPS/2 ALPS GlidePoint" as which the trackpoint/touchpad is recognized seems to be a different type of touchpad without a trackstick (and mouse buttons)

My assumption is that the trackpoint/touchpad device in my laptop is either wrongly detected by psmouse or not supported at all.

Is there anybody out there who also owns a L570 and has a solution or could at least give me a hint?

Many thanks
CHL
_________________
The difficulty in designing something completely foolproof, is not to underestimate the ingenuity of complete fools.
Back to top
View user's profile Send private message
chl
n00b
n00b


Joined: 13 May 2003
Posts: 70
Location: Munich

PostPosted: Tue Jan 23, 2018 10:24 pm    Post subject: Reply with quote

I have partially solved the problem.

I figured out, that until kernel 4.12.9 the touchpad/trackpoint are properly recognized and working. Starting with kernel 4.12.10 things are broken.

The culprit seems to be this commit: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/drivers/input/mouse/alps.c?id=4a646580f793d19717f7e034c8d473b509c27d49. When reverting the changes made by it, the touchpad/trackpoint works with all later kernels including 4.14.14.

Here is a patch for those who are interested:

Code:

--- a/drivers/input/mouse/alps.c   2017-11-12 19:46:13.000000000 +0100
+++ b/drivers/input/mouse/alps.c   2018-01-23 21:38:20.163831307 +0100
@@ -1215,24 +1215,14 @@
 
    case SS4_PACKET_ID_TWO:
       if (priv->flags & ALPS_BUTTONPAD) {
-         if (IS_SS4PLUS_DEV(priv->dev_id)) {
-            f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
-         } else {
-            f->mt[0].x = SS4_BTL_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_BTL_MF_X_V2(p, 1);
-         }
+         f->mt[0].x = SS4_BTL_MF_X_V2(p, 0);
          f->mt[0].y = SS4_BTL_MF_Y_V2(p, 0);
+         f->mt[1].x = SS4_BTL_MF_X_V2(p, 1);
          f->mt[1].y = SS4_BTL_MF_Y_V2(p, 1);
       } else {
-         if (IS_SS4PLUS_DEV(priv->dev_id)) {
-            f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
-         } else {
-            f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
-         }
+         f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
          f->mt[0].y = SS4_STD_MF_Y_V2(p, 0);
+         f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
          f->mt[1].y = SS4_STD_MF_Y_V2(p, 1);
       }
       f->pressure = SS4_MF_Z_V2(p, 0) ? 0x30 : 0;
@@ -1249,27 +1239,16 @@
 
    case SS4_PACKET_ID_MULTI:
       if (priv->flags & ALPS_BUTTONPAD) {
-         if (IS_SS4PLUS_DEV(priv->dev_id)) {
-            f->mt[0].x = SS4_PLUS_BTL_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_PLUS_BTL_MF_X_V2(p, 1);
-         } else {
-            f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
-            f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
-         }
-
+         f->mt[2].x = SS4_BTL_MF_X_V2(p, 0);
          f->mt[2].y = SS4_BTL_MF_Y_V2(p, 0);
+         f->mt[3].x = SS4_BTL_MF_X_V2(p, 1);
          f->mt[3].y = SS4_BTL_MF_Y_V2(p, 1);
          no_data_x = SS4_MFPACKET_NO_AX_BL;
          no_data_y = SS4_MFPACKET_NO_AY_BL;
       } else {
-         if (IS_SS4PLUS_DEV(priv->dev_id)) {
-            f->mt[0].x = SS4_PLUS_STD_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_PLUS_STD_MF_X_V2(p, 1);
-         } else {
-            f->mt[0].x = SS4_STD_MF_X_V2(p, 0);
-            f->mt[1].x = SS4_STD_MF_X_V2(p, 1);
-         }
+         f->mt[2].x = SS4_STD_MF_X_V2(p, 0);
          f->mt[2].y = SS4_STD_MF_Y_V2(p, 0);
+         f->mt[3].x = SS4_STD_MF_X_V2(p, 1);
          f->mt[3].y = SS4_STD_MF_Y_V2(p, 1);
          no_data_x = SS4_MFPACKET_NO_AX;
          no_data_y = SS4_MFPACKET_NO_AY;
@@ -2562,8 +2541,8 @@
 
    memset(otp, 0, sizeof(otp));
 
-   if (alps_get_otp_values_ss4_v2(psmouse, 1, &otp[1][0]) ||
-       alps_get_otp_values_ss4_v2(psmouse, 0, &otp[0][0]))
+   if (alps_get_otp_values_ss4_v2(psmouse, 0, &otp[0][0]) ||
+       alps_get_otp_values_ss4_v2(psmouse, 1, &otp[1][0]))
       return -1;
 
    alps_update_device_area_ss4_v2(otp, priv);
--- a/drivers/input/mouse/alps.h   2017-11-12 19:46:13.000000000 +0100
+++ b/drivers/input/mouse/alps.h   2018-01-23 21:38:20.163831307 +0100
@@ -100,10 +100,6 @@
              ((_b[1 + _i * 3]  << 5) & 0x1F00)   \
             )
 
-#define SS4_PLUS_STD_MF_X_V2(_b, _i) (((_b[0 + (_i) * 3] << 4) & 0x0070) | \
-             ((_b[1 + (_i) * 3]  << 4) & 0x0F80)   \
-            )
-
 #define SS4_STD_MF_Y_V2(_b, _i)   (((_b[1 + (_i) * 3] << 3) & 0x0010) |   \
              ((_b[2 + (_i) * 3] << 5) & 0x01E0) |   \
              ((_b[2 + (_i) * 3] << 4) & 0x0E00)   \
@@ -113,10 +109,6 @@
              ((_b[0 + (_i) * 3] >> 3) & 0x0010)   \
             )
 
-#define SS4_PLUS_BTL_MF_X_V2(_b, _i) (SS4_PLUS_STD_MF_X_V2(_b, _i) |   \
-             ((_b[0 + (_i) * 3] >> 4) & 0x0008)   \
-            )
-
 #define SS4_BTL_MF_Y_V2(_b, _i)   (SS4_STD_MF_Y_V2(_b, _i) | \
              ((_b[0 + (_i) * 3] >> 3) & 0x0008)   \
             )


If some of you could successfully test the patch I would file a kernel bug.

All the best
CHL
_________________
The difficulty in designing something completely foolproof, is not to underestimate the ingenuity of complete fools.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum