Skip to content

Commit 05e8fd9

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Handle failing HID_DG_CONTACTMAX requests
Hardware may not respond to a request for the HID_DG_CONTACTMAX feature and we should be tolerant of such a failure. This is especially true when using hid-replay where the hardware doesn't exist, but also for devices attached to a flaky bus. This patch increases the number of allowable retries to match other calls to 'wacom_get_report' and also provides a fallback which forces 'touch_max = 16' (enough for any Wacom device seen so far). Signed-off-by: Jason Gerecke <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent aef3156 commit 05e8fd9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/hid/wacom_sys.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,16 @@ static void wacom_feature_mapping(struct hid_device *hdev,
125125
break;
126126
data[0] = field->report->id;
127127
ret = wacom_get_report(hdev, HID_FEATURE_REPORT,
128-
data, 2, 0);
129-
if (ret == 2)
128+
data, 2, WAC_CMD_RETRIES);
129+
if (ret == 2) {
130130
features->touch_max = data[1];
131+
} else {
132+
features->touch_max = 16;
133+
hid_warn(hdev, "wacom_feature_mapping: "
134+
"could not get HID_DG_CONTACTMAX, "
135+
"defaulting to %d\n",
136+
features->touch_max);
137+
}
131138
kfree(data);
132139
}
133140
break;

0 commit comments

Comments
 (0)