]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
authorPeter Hutterer <peter.hutterer@who-t.net>
Sun, 21 Dec 2025 23:43:34 +0000 (09:43 +1000)
committerBenjamin Tissoires <bentiss@kernel.org>
Wed, 7 Jan 2026 14:28:09 +0000 (15:28 +0100)
A Digitizer/Button Type value of 1 indicates the device is a
pressurepad, see
https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-multitouch.c

index a0c1ad5acb6706255cb342d3503123af57b1c8e9..b1c3ef1290587780c7f68f53a34ac575c2fd7c92 100644 (file)
@@ -81,6 +81,7 @@ MODULE_LICENSE("GPL");
 #define MT_INPUTMODE_TOUCHPAD          0x03
 
 #define MT_BUTTONTYPE_CLICKPAD         0
+#define MT_BUTTONTYPE_PRESSUREPAD      1
 
 enum latency_mode {
        HID_LATENCY_NORMAL = 0,
@@ -179,6 +180,7 @@ struct mt_device {
        __u8 inputmode_value;   /* InputMode HID feature value */
        __u8 maxcontacts;
        bool is_buttonpad;      /* is this device a button pad? */
+       bool is_pressurepad;    /* is this device a pressurepad? */
        bool is_haptic_touchpad;        /* is this device a haptic touchpad? */
        bool serial_maybe;      /* need to check for serial protocol */
 
@@ -531,8 +533,14 @@ static void mt_feature_mapping(struct hid_device *hdev,
                }
 
                mt_get_feature(hdev, field->report);
-               if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
+               switch (field->value[usage->usage_index]) {
+               case MT_BUTTONTYPE_CLICKPAD:
                        td->is_buttonpad = true;
+                       break;
+               case MT_BUTTONTYPE_PRESSUREPAD:
+                       td->is_pressurepad = true;
+                       break;
+               }
 
                break;
        case 0xff0000c5:
@@ -1394,6 +1402,8 @@ static int mt_touch_input_configured(struct hid_device *hdev,
 
        if (td->is_buttonpad)
                __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
+       if (td->is_pressurepad)
+               __set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
 
        app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
                                               BITS_TO_LONGS(td->maxcontacts),