aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-wacom.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-10-25 03:58:12 -0400
committerJiri Kosina <jkosina@suse.cz>2011-10-25 03:58:12 -0400
commitf6f12427844516bc8e9cf84f43aca7bbbaa48157 (patch)
treec3ac710e02d65fc08629b25fcfba0e79e0092910 /drivers/hid/hid-wacom.c
parentb0eae38cebc54e618896d3e6a799939da51a8cac (diff)
parentbca621421c53caf73f36e181d6e5fe41fe0da7a7 (diff)
Merge branch 'upstream-fixes' into for-linus
Conflicts: drivers/hid/hid-wacom.c
Diffstat (limited to 'drivers/hid/hid-wacom.c')
-rw-r--r--drivers/hid/hid-wacom.c81
1 files changed, 43 insertions, 38 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 72ca689b647..17bb88f782b 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -304,11 +304,51 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
304 return 1; 304 return 1;
305} 305}
306 306
307static int wacom_input_mapped(struct hid_device *hdev, struct hid_input *hi,
308 struct hid_field *field, struct hid_usage *usage, unsigned long **bit,
309 int *max)
310{
311 struct input_dev *input = hi->input;
312
313 __set_bit(INPUT_PROP_POINTER, input->propbit);
314
315 /* Basics */
316 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);
317
318 __set_bit(REL_WHEEL, input->relbit);
319
320 __set_bit(BTN_TOOL_PEN, input->keybit);
321 __set_bit(BTN_TOUCH, input->keybit);
322 __set_bit(BTN_STYLUS, input->keybit);
323 __set_bit(BTN_STYLUS2, input->keybit);
324 __set_bit(BTN_LEFT, input->keybit);
325 __set_bit(BTN_RIGHT, input->keybit);
326 __set_bit(BTN_MIDDLE, input->keybit);
327
328 /* Pad */
329 input->evbit[0] |= BIT(EV_MSC);
330
331 __set_bit(MSC_SERIAL, input->mscbit);
332
333 __set_bit(BTN_0, input->keybit);
334 __set_bit(BTN_1, input->keybit);
335 __set_bit(BTN_TOOL_FINGER, input->keybit);
336
337 /* Distance, rubber and mouse */
338 __set_bit(BTN_TOOL_RUBBER, input->keybit);
339 __set_bit(BTN_TOOL_MOUSE, input->keybit);
340
341 input_set_abs_params(input, ABS_X, 0, 16704, 4, 0);
342 input_set_abs_params(input, ABS_Y, 0, 12064, 4, 0);
343 input_set_abs_params(input, ABS_PRESSURE, 0, 511, 0, 0);
344 input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
345
346 return 0;
347}
348
307static int wacom_probe(struct hid_device *hdev, 349static int wacom_probe(struct hid_device *hdev,
308 const struct hid_device_id *id) 350 const struct hid_device_id *id)
309{ 351{
310 struct hid_input *hidinput;
311 struct input_dev *input;
312 struct wacom_data *wdata; 352 struct wacom_data *wdata;
313 int ret; 353 int ret;
314 354
@@ -370,42 +410,6 @@ static int wacom_probe(struct hid_device *hdev,
370 goto err_ac; 410 goto err_ac;
371 } 411 }
372#endif 412#endif
373 hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
374 input = hidinput->input;
375
376 __set_bit(INPUT_PROP_POINTER, input->propbit);
377
378 /* Basics */
379 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);
380
381 __set_bit(REL_WHEEL, input->relbit);
382
383 __set_bit(BTN_TOOL_PEN, input->keybit);
384 __set_bit(BTN_TOUCH, input->keybit);
385 __set_bit(BTN_STYLUS, input->keybit);
386 __set_bit(BTN_STYLUS2, input->keybit);
387 __set_bit(BTN_LEFT, input->keybit);
388 __set_bit(BTN_RIGHT, input->keybit);
389 __set_bit(BTN_MIDDLE, input->keybit);
390
391 /* Pad */
392 input->evbit[0] |= BIT(EV_MSC);
393
394 __set_bit(MSC_SERIAL, input->mscbit);
395
396 __set_bit(BTN_0, input->keybit);
397 __set_bit(BTN_1, input->keybit);
398 __set_bit(BTN_TOOL_FINGER, input->keybit);
399
400 /* Distance, rubber and mouse */
401 __set_bit(BTN_TOOL_RUBBER, input->keybit);
402 __set_bit(BTN_TOOL_MOUSE, input->keybit);
403
404 input_set_abs_params(input, ABS_X, 0, 16704, 4, 0);
405 input_set_abs_params(input, ABS_Y, 0, 12064, 4, 0);
406 input_set_abs_params(input, ABS_PRESSURE, 0, 511, 0, 0);
407 input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
408
409 return 0; 413 return 0;
410 414
411#ifdef CONFIG_HID_WACOM_POWER_SUPPLY 415#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
@@ -448,6 +452,7 @@ static struct hid_driver wacom_driver = {
448 .probe = wacom_probe, 452 .probe = wacom_probe,
449 .remove = wacom_remove, 453 .remove = wacom_remove,
450 .raw_event = wacom_raw_event, 454 .raw_event = wacom_raw_event,
455 .input_mapped = wacom_input_mapped,
451}; 456};
452 457
453static int __init wacom_init(void) 458static int __init wacom_init(void)