aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/wacom_sys.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-08-06 16:52:56 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-08-06 17:18:11 -0400
commit387142bb8fcb263771e1fa6b1a96e6a7ca36e820 (patch)
treeef23bfa3991b5d35c7fec71c767d5bf5de2f5217 /drivers/hid/wacom_sys.c
parentf81a1295cd9b6d3d3d7d7126e522d80917134b41 (diff)
Input: wacom - handle Graphire BT tablets in wacom.ko
First, merge the Graphire BT tablet. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r--drivers/hid/wacom_sys.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 18154a5459b5..c21e58ba0693 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -265,6 +265,39 @@ static int wacom_set_device_mode(struct hid_device *hdev, int report_id,
265static int wacom_bt_query_tablet_data(struct hid_device *hdev, u8 speed, 265static int wacom_bt_query_tablet_data(struct hid_device *hdev, u8 speed,
266 struct wacom_features *features) 266 struct wacom_features *features)
267{ 267{
268 struct wacom *wacom = hid_get_drvdata(hdev);
269 int ret;
270 u8 rep_data[2];
271
272 switch (features->type) {
273 case GRAPHIRE_BT:
274 rep_data[0] = 0x03;
275 rep_data[1] = 0x00;
276 ret = wacom_set_report(hdev, HID_FEATURE_REPORT,
277 rep_data[0], rep_data, 2, 3);
278
279 if (ret >= 0) {
280 rep_data[0] = speed == 0 ? 0x05 : 0x06;
281 rep_data[1] = 0x00;
282
283 ret = wacom_set_report(hdev, HID_FEATURE_REPORT,
284 rep_data[0], rep_data, 2, 3);
285
286 if (ret >= 0) {
287 wacom->wacom_wac.bt_high_speed = speed;
288 return 0;
289 }
290 }
291
292 /*
293 * Note that if the raw queries fail, it's not a hard failure
294 * and it is safe to continue
295 */
296 hid_warn(hdev, "failed to poke device, command %d, err %d\n",
297 rep_data[0], ret);
298 break;
299 }
300
268 return 0; 301 return 0;
269} 302}
270 303