Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type

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>

authored by

Peter Hutterer and committed by
Benjamin Tissoires
2b29a901 c06bc355

+11 -1
+11 -1
drivers/hid/hid-multitouch.c
··· 81 81 #define MT_INPUTMODE_TOUCHPAD 0x03 82 82 83 83 #define MT_BUTTONTYPE_CLICKPAD 0 84 + #define MT_BUTTONTYPE_PRESSUREPAD 1 84 85 85 86 enum latency_mode { 86 87 HID_LATENCY_NORMAL = 0, ··· 180 179 __u8 inputmode_value; /* InputMode HID feature value */ 181 180 __u8 maxcontacts; 182 181 bool is_buttonpad; /* is this device a button pad? */ 182 + bool is_pressurepad; /* is this device a pressurepad? */ 183 183 bool is_haptic_touchpad; /* is this device a haptic touchpad? */ 184 184 bool serial_maybe; /* need to check for serial protocol */ 185 185 ··· 533 531 } 534 532 535 533 mt_get_feature(hdev, field->report); 536 - if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD) 534 + switch (field->value[usage->usage_index]) { 535 + case MT_BUTTONTYPE_CLICKPAD: 537 536 td->is_buttonpad = true; 537 + break; 538 + case MT_BUTTONTYPE_PRESSUREPAD: 539 + td->is_pressurepad = true; 540 + break; 541 + } 538 542 539 543 break; 540 544 case 0xff0000c5: ··· 1402 1394 1403 1395 if (td->is_buttonpad) 1404 1396 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); 1397 + if (td->is_pressurepad) 1398 + __set_bit(INPUT_PROP_PRESSUREPAD, input->propbit); 1405 1399 1406 1400 app->pending_palm_slots = devm_kcalloc(&hi->input->dev, 1407 1401 BITS_TO_LONGS(td->maxcontacts),