Skip to content

Commit 2b29a90

Browse files
whotBenjamin Tissoires
authored andcommitted
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>
1 parent c06bc35 commit 2b29a90

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/hid/hid-multitouch.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ MODULE_LICENSE("GPL");
8181
#define MT_INPUTMODE_TOUCHPAD 0x03
8282

8383
#define MT_BUTTONTYPE_CLICKPAD 0
84+
#define MT_BUTTONTYPE_PRESSUREPAD 1
8485

8586
enum latency_mode {
8687
HID_LATENCY_NORMAL = 0,
@@ -179,6 +180,7 @@ struct mt_device {
179180
__u8 inputmode_value; /* InputMode HID feature value */
180181
__u8 maxcontacts;
181182
bool is_buttonpad; /* is this device a button pad? */
183+
bool is_pressurepad; /* is this device a pressurepad? */
182184
bool is_haptic_touchpad; /* is this device a haptic touchpad? */
183185
bool serial_maybe; /* need to check for serial protocol */
184186

@@ -531,8 +533,14 @@ static void mt_feature_mapping(struct hid_device *hdev,
531533
}
532534

533535
mt_get_feature(hdev, field->report);
534-
if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
536+
switch (field->value[usage->usage_index]) {
537+
case MT_BUTTONTYPE_CLICKPAD:
535538
td->is_buttonpad = true;
539+
break;
540+
case MT_BUTTONTYPE_PRESSUREPAD:
541+
td->is_pressurepad = true;
542+
break;
543+
}
536544

537545
break;
538546
case 0xff0000c5:
@@ -1394,6 +1402,8 @@ static int mt_touch_input_configured(struct hid_device *hdev,
13941402

13951403
if (td->is_buttonpad)
13961404
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
1405+
if (td->is_pressurepad)
1406+
__set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
13971407

13981408
app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
13991409
BITS_TO_LONGS(td->maxcontacts),

0 commit comments

Comments
 (0)