aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-09-16 16:56:39 -0400
committerJiri Kosina <jkosina@suse.cz>2014-09-22 10:54:36 -0400
commit8ffffd5212846b72f116f7a9572e83d580e25802 (patch)
tree57a8541176aa8be219445f8eafea7818e1bf1744
parent12969e3bdce5f63fbce2b6d616fdbc8eeb539f01 (diff)
HID: wacom: fix timeout on probe for some wacoms
Some Wacom tablets (at least the ISDv4 found in the Lenovo X230) timeout during probe while retrieving the input reports. The only time this information is valuable is during the feature_mapping stage, so we can ask for it there and discard the generic input reports retrieval. This gives a code path closer to the wacom.ko driver when it was in the input subtree (not HID). Cc: stable@vger.kernel.org # requires cherry-pick of c64d883476 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/wacom_sys.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index a8b7f16f76fa..25086287957e 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -110,12 +110,24 @@ static void wacom_feature_mapping(struct hid_device *hdev,
110{ 110{
111 struct wacom *wacom = hid_get_drvdata(hdev); 111 struct wacom *wacom = hid_get_drvdata(hdev);
112 struct wacom_features *features = &wacom->wacom_wac.features; 112 struct wacom_features *features = &wacom->wacom_wac.features;
113 u8 *data;
114 int ret;
113 115
114 switch (usage->hid) { 116 switch (usage->hid) {
115 case HID_DG_CONTACTMAX: 117 case HID_DG_CONTACTMAX:
116 /* leave touch_max as is if predefined */ 118 /* leave touch_max as is if predefined */
117 if (!features->touch_max) 119 if (!features->touch_max) {
118 features->touch_max = field->value[0]; 120 /* read manually */
121 data = kzalloc(2, GFP_KERNEL);
122 if (!data)
123 break;
124 data[0] = field->report->id;
125 ret = wacom_get_report(hdev, HID_FEATURE_REPORT,
126 data, 2, 0);
127 if (ret == 2)
128 features->touch_max = data[1];
129 kfree(data);
130 }
119 break; 131 break;
120 } 132 }
121} 133}
@@ -1280,6 +1292,8 @@ static int wacom_probe(struct hid_device *hdev,
1280 if (!id->driver_data) 1292 if (!id->driver_data)
1281 return -EINVAL; 1293 return -EINVAL;
1282 1294
1295 hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS;
1296
1283 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); 1297 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
1284 if (!wacom) 1298 if (!wacom)
1285 return -ENOMEM; 1299 return -ENOMEM;