Bug 89641 - Touchpad on E440 uses wrong min max values
Summary: Touchpad on E440 uses wrong min max values
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-12 22:30 UTC by Filip Ayazi
Modified: 2015-04-08 19:13 UTC (History)
3 users (show)

See Also:
Kernel Version: v3.18
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Patch to make ranges from the device override hardcoded values (1.07 KB, patch)
2014-12-12 23:16 UTC, Filip Ayazi
Details | Diff
Set correct min-max values for E440 (968 bytes, patch)
2015-03-06 13:16 UTC, Filip Ayazi
Details | Diff

Description Filip Ayazi 2014-12-12 22:30:44 UTC
Commit bce4f9e76 (Input: synaptics - adjust min/max on Thinkpad E540) breaks touchpad functionality on Lenovo Edge E440 (right-click only works on extreme right of the touchpad and scrolling doesn't work at all). It seems that E540 and E440 use the same touchpad device (LEN2006) but have different edge coordinates. The min-max values currently set for LEN2006 in drivers/input/mouse/synaptics.c are {1264, 5675, 1171, 4688}, the values reported by touchpad-edge-detector and verified working for my E440 are {1024, 3398, 1024, 2457}. Reverting the aforementioned patch or changing the values fixes the issue but likely breaks touchpad on E540.
Possible solution is to allow coordinates from the device (if it has the capability) to overwrite those set as a min-max-quirk, but this will not work on devices that declare the capability but respond with incorrect values.
Comment 1 Filip Ayazi 2014-12-12 22:47:26 UTC
Here is a simple patch to implement the fix.


diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index f947292..c5e3ffe 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -361,7 +361,7 @@ static int synaptics_resolution(struct psmouse *psmouse)
                        priv->x_max = min_max_pnpid_table[i].x_max;
                        priv->y_min = min_max_pnpid_table[i].y_min;
                        priv->y_max = min_max_pnpid_table[i].y_max;
-                       return 0;
+                       break;
                }
        }
Comment 2 Filip Ayazi 2014-12-12 23:16:47 UTC
Created attachment 160421 [details]
Patch to make ranges from the device override hardcoded values

Implements the mentioned possible fix.
Comment 3 Dmitry Torokhov 2014-12-18 01:18:35 UTC
Ben, without the original patch, what was the touchpad's behavior? It looks like we have a clash...

Filip, what are the min/max ranges reported by your device (not touchpad-edge-detector, but the ABS ranges with your patch)?
Comment 4 bensagal 2014-12-18 06:45:15 UTC
The touchpad was jumpy at the edge of the pad
Comment 5 Filip Ayazi 2014-12-18 09:46:44 UTC
Touchpad-edge-detector reports these values from the kernel with the patch (I believe these are the values reported by the device):
kernel x[1264..5044] y[1171..3398]
and values touchpad sends
touchpad x[1024..5044] y[2457..4832]
These values are for some reason different from those I got few days ago and different from those reported to the kernel (it appears to be working fine even though the values are off).

I suppose it might be a hardware problem with my device, can someone with the same laptop verify this?
Comment 6 Filip Ayazi 2015-03-06 13:15:05 UTC
I tested another thinkpad E440 yesterday, and the behaviour and measured values were the same as on mine x[1024..5045] y[2457..4832] and the values reported to the kernel were still wrong (and therefore the patch is wrong).

This was not noticeable on Linux Mint (cinnamon), but made the touchpad almost unusable in Lubuntu for some reason...

Attached is a patch to overwrite the values set for E540, if it is of any use to anyone, but it really is a clash.
Comment 7 Filip Ayazi 2015-03-06 13:16:25 UTC
Created attachment 169551 [details]
Set correct min-max values for E440
Comment 8 Dmitry Torokhov 2015-03-09 20:42:38 UTC
Can you please try the kernel form "synaptics" branch of http://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git ? It has quite a bit of changes to address issues with the touchpads on Lenovo boxes.

Note You need to log in before you can comment on or make changes to this bug.