quirks: touchpad: add ModelPressurePad
authorJosé Expósito <jose.exposito89@gmail.com>
Mon, 16 Jan 2023 18:18:40 +0000 (19:18 +0100)
committerJosé Expósito <jose.exposito89@gmail.com>
Mon, 16 Jan 2023 18:22:04 +0000 (19:22 +0100)
Unlike in traditional touchpads, whose pressure value equals contact
size, on pressure pads pressure is a real physical axis.

We don't take advantage of the pressure information reported by
pressure pads yet, so we disable it to avoid errors.

Add a new model quirk for pressure pads instead of disabling
ABS_MT_PRESSURE and ABS_PRESSURE.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
doc/user/device-quirks.rst
quirks/50-system-dell.quirks
quirks/50-system-lenovo.quirks
src/evdev-mt-touchpad.c
src/quirks.c
src/quirks.h

index d7461b0872b9c642d3e1aca03956ac78358dc594..deced5216b3a4214424269112a1077e21559ea9f 100644 (file)
@@ -147,6 +147,10 @@ ModelBouncingKeys
     timestamps can not be relied upon.
 ModelSynapticsSerialTouchpad
     Reserved for touchpads made by Synaptics on the serial bus
+ModelPressurePad
+    Unlike in traditional touchpads, whose pressure value equals contact size,
+    on pressure pads pressure is a real physical axis.
+    Indicates that the device is a pressure pad.
 AttrSizeHint=NxM, AttrResolutionHint=N
     Hints at the width x height of the device in mm, or the resolution
     of the x/y axis in units/mm. These may only be used where they apply to
index b4605c76cecc06b26a0ccdb0bd4f642773403ecc..a09a3a3a2a21d07cbeb2b43f6ffd7751cd5516b4 100644 (file)
@@ -120,4 +120,4 @@ ModelTabletModeNoSuspend=1
 MatchBus=i2c
 MatchVendor=0x27C6
 MatchProduct=0x0F60
-AttrEventCode=-ABS_MT_PRESSURE;-ABS_PRESSURE;
+ModelPressurePad=1
index ade458832f0a89ac5917734a2b34afcd56140b34..551d23c25aa14837d6242c0c01b7372e09f22dfb 100644 (file)
@@ -147,7 +147,7 @@ AttrTrackpointMultiplier=1.25
 MatchBus=i2c
 MatchVendor=0x06CB
 MatchProduct=0xCE37
-AttrEventCode=-ABS_MT_PRESSURE;-ABS_PRESSURE;
+ModelPressurePad=1
 
 [Lenovo Yoga C930 Tablet]
 MatchBus=i2c
@@ -272,7 +272,7 @@ AttrKeyboardIntegration=internal
 MatchBus=i2c
 MatchVendor=0x27C6
 MatchProduct=0x01E8
-AttrEventCode=-ABS_MT_PRESSURE;-ABS_PRESSURE;
+ModelPressurePad=1
 
 # Duet 7i tablet switch activated by folding keyboard cover, or removing it.
 # We must not disable volume rocker 'keyboard'.
index c79133b5db4d1d4963cd2564533c86ef7460a070..1ccf80370695cfbb67c1a2967de5df9aed6f4d01 100644 (file)
@@ -3702,7 +3702,8 @@ tp_init_pressurepad(struct tp_dispatch *tp,
         *
         * See also #562
         */
-       if (libevdev_get_abs_resolution(device->evdev, ABS_MT_PRESSURE) != 0) {
+       if (libevdev_get_abs_resolution(device->evdev, ABS_MT_PRESSURE) != 0 ||
+           evdev_device_has_model_quirk(device, QUIRK_MODEL_PRESSURE_PAD)) {
                libevdev_disable_event_code(device->evdev, EV_ABS, ABS_MT_PRESSURE);
                libevdev_disable_event_code(device->evdev, EV_ABS, ABS_PRESSURE);
        }
index 0e3006b5cd387bc7acf64a469f2f23ab5e8c018f..7e9160091fc526a1f8c76fdb061775d3796639b3 100644 (file)
@@ -269,6 +269,7 @@ quirk_get_name(enum quirk q)
        case QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER:       return "ModelTouchpadVisibleMarker";
        case QUIRK_MODEL_TRACKBALL:                     return "ModelTrackball";
        case QUIRK_MODEL_WACOM_TOUCHPAD:                return "ModelWacomTouchpad";
+       case QUIRK_MODEL_PRESSURE_PAD:                  return "ModelPressurePad";
 
        case QUIRK_ATTR_SIZE_HINT:                      return "AttrSizeHint";
        case QUIRK_ATTR_TOUCH_SIZE_RANGE:               return "AttrTouchSizeRange";
index bd96c3af4b4c179123ac488e8947e71c2de87e1e..30878546f6f3df0828bb5fba825dad70a8ab04cd 100644 (file)
@@ -86,6 +86,7 @@ enum quirk {
        QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER,
        QUIRK_MODEL_TRACKBALL,
        QUIRK_MODEL_WACOM_TOUCHPAD,
+       QUIRK_MODEL_PRESSURE_PAD,
 
        _QUIRK_LAST_MODEL_QUIRK_, /* Guard: do not modify */