evdev: disable pressure on the Asus UX302LA touchpad
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 19 Sep 2018 23:20:18 +0000 (09:20 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 26 Sep 2018 03:49:13 +0000 (13:49 +1000)
This touchpad stops sending pressure data after the first frame of the second
finger down. If the initial pressure is too light, the finger doesn't get
detected even when the pressure increases in the future.

This thing is from 2014, so let's just disable the pressure axes on it
and skip the pressure-based touch detection code. Let's hope that it doesn't
also have ghost touches on light interactions...

Fixes #145

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
quirks/50-system-asus.quirks
src/evdev.c
src/quirks.c
src/quirks.h

index 8d7fca5..e03c39e 100644 (file)
@@ -9,3 +9,8 @@ ModelTouchpadVisibleMarker=1
 MatchName=*ETPS/2 Elantech Touchpad*
 MatchDMIModalias=dmi:*svnASUSTeKComputerInc.:pnUX21E:*
 AttrPressureRange=24:10
+
+[Asus UX302LA]
+MatchName=*ETPS/2 Elantech Touchpad*
+MatchDMIModalias=dmi:*svnASUSTeKCOMPUTERINC.:pnUX302LA:*
+ModelAsusUX302LATouchpad=1
index 4afdbce..25bb6e2 100644 (file)
@@ -1976,6 +1976,20 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
                                            EV_ABS,
                                            ABS_MT_TOOL_TYPE);
 
+       /* Asus UX302LA touchpad doesn't update the pressure values once two
+        * fingers are down. So let's just pretend it doesn't have pressure
+        * at all. https://gitlab.freedesktop.org/libinput/libinput/issues/145
+        */
+       if (evdev_device_has_model_quirk(device,
+                                        QUIRK_MODEL_ASUS_UX320LA_TOUCHPAD)) {
+               libevdev_disable_event_code(device->evdev,
+                                           EV_ABS,
+                                           ABS_MT_PRESSURE);
+               libevdev_disable_event_code(device->evdev,
+                                           EV_ABS,
+                                           ABS_PRESSURE);
+       }
+
        /* Generally we don't care about MSC_TIMESTAMP and it can cause
         * unnecessary wakeups but on some devices we need to watch it for
         * pointer jumps */
index 22c86d0..a65ce4f 100644 (file)
@@ -231,6 +231,7 @@ quirk_get_name(enum quirk q)
        case QUIRK_MODEL_APPLE_MAGICMOUSE:              return "ModelAppleMagicMouse";
        case QUIRK_MODEL_APPLE_TOUCHPAD:                return "ModelAppleTouchpad";
        case QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON:      return "ModelAppleTouchpadOneButton";
+       case QUIRK_MODEL_ASUS_UX320LA_TOUCHPAD:         return "ModelAsusUX302LATouchpad";
        case QUIRK_MODEL_BOUNCING_KEYS:                 return "ModelBouncingKeys";
        case QUIRK_MODEL_CHROMEBOOK:                    return "ModelChromebook";
        case QUIRK_MODEL_CLEVO_W740SU:                  return "ModelClevoW740SU";
index bd08a19..d032c8a 100644 (file)
@@ -58,6 +58,7 @@ enum quirk {
        QUIRK_MODEL_APPLE_MAGICMOUSE,
        QUIRK_MODEL_APPLE_TOUCHPAD,
        QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON,
+       QUIRK_MODEL_ASUS_UX320LA_TOUCHPAD,
        QUIRK_MODEL_BOUNCING_KEYS,
        QUIRK_MODEL_CHROMEBOOK,
        QUIRK_MODEL_CLEVO_W740SU,