diff options
author | Jason Gerecke <killertofu@gmail.com> | 2015-05-21 10:44:32 -0700 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-05-21 21:37:39 +0200 |
commit | 05e8fd9202247ac6cdc26f6bafb5453120065490 (patch) | |
tree | d197755fcdc245493b5a873c6260fb10e066b949 /drivers/hid/wacom_sys.c | |
parent | aef3156d7294ac878c10ca8f02539b49adee9624 (diff) | |
download | linux-05e8fd9202247ac6cdc26f6bafb5453120065490.tar.bz2 |
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 <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r-- | drivers/hid/wacom_sys.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 109312f9d3de..eea18a6cbdc7 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -125,9 +125,16 @@ static void wacom_feature_mapping(struct hid_device *hdev, break; data[0] = field->report->id; ret = wacom_get_report(hdev, HID_FEATURE_REPORT, - data, 2, 0); - if (ret == 2) + data, 2, WAC_CMD_RETRIES); + if (ret == 2) { features->touch_max = data[1]; + } else { + features->touch_max = 16; + hid_warn(hdev, "wacom_feature_mapping: " + "could not get HID_DG_CONTACTMAX, " + "defaulting to %d\n", + features->touch_max); + } kfree(data); } break; |