aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-08-02 23:15:17 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-08-02 23:29:56 -0400
commit987a6c0298260b7aa40702b349282554d6180e4b (patch)
tree29d0873435221a6d731267efc2412814440e4a28 /drivers/hid
parent7957e9c4d175cc065f4277211fcb7d784fcee860 (diff)
Input: switch to input_abs_*() access functions
Change all call sites in drivers/input to not access the ABS axis information directly anymore. Make them use the access helpers instead. Also use input_set_abs_params() when possible. Did some code refactoring as I was on it. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-wacom.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 1e051f1171e4..1c4b4ca19195 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -230,7 +230,7 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
230 input_report_key(input, BTN_RIGHT, 0); 230 input_report_key(input, BTN_RIGHT, 0);
231 input_report_key(input, BTN_MIDDLE, 0); 231 input_report_key(input, BTN_MIDDLE, 0);
232 input_report_abs(input, ABS_DISTANCE, 232 input_report_abs(input, ABS_DISTANCE,
233 input->absmax[ABS_DISTANCE]); 233 input_abs_get_max(input, ABS_DISTANCE));
234 } else { 234 } else {
235 input_report_key(input, BTN_TOUCH, 0); 235 input_report_key(input, BTN_TOUCH, 0);
236 input_report_key(input, BTN_STYLUS, 0); 236 input_report_key(input, BTN_STYLUS, 0);
@@ -383,38 +383,37 @@ move_on:
383 383
384 /* Basics */ 384 /* Basics */
385 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL); 385 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);
386 input->absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | 386
387 BIT(ABS_PRESSURE) | BIT(ABS_DISTANCE); 387 __set_bit(REL_WHEEL, input->relbit);
388 input->relbit[0] |= BIT(REL_WHEEL); 388
389 set_bit(BTN_TOOL_PEN, input->keybit); 389 __set_bit(BTN_TOOL_PEN, input->keybit);
390 set_bit(BTN_TOUCH, input->keybit); 390 __set_bit(BTN_TOUCH, input->keybit);
391 set_bit(BTN_STYLUS, input->keybit); 391 __set_bit(BTN_STYLUS, input->keybit);
392 set_bit(BTN_STYLUS2, input->keybit); 392 __set_bit(BTN_STYLUS2, input->keybit);
393 set_bit(BTN_LEFT, input->keybit); 393 __set_bit(BTN_LEFT, input->keybit);
394 set_bit(BTN_RIGHT, input->keybit); 394 __set_bit(BTN_RIGHT, input->keybit);
395 set_bit(BTN_MIDDLE, input->keybit); 395 __set_bit(BTN_MIDDLE, input->keybit);
396 396
397 /* Pad */ 397 /* Pad */
398 input->evbit[0] |= BIT(EV_MSC); 398 input->evbit[0] |= BIT(EV_MSC);
399 input->mscbit[0] |= BIT(MSC_SERIAL);
400 set_bit(BTN_0, input->keybit);
401 set_bit(BTN_1, input->keybit);
402 set_bit(BTN_TOOL_FINGER, input->keybit);
403 399
404 /* Distance, rubber and mouse */ 400 __set_bit(MSC_SERIAL, input->mscbit);
405 input->absbit[0] |= BIT(ABS_DISTANCE);
406 set_bit(BTN_TOOL_RUBBER, input->keybit);
407 set_bit(BTN_TOOL_MOUSE, input->keybit);
408 401
409 input->absmax[ABS_PRESSURE] = 511; 402 __set_bit(BTN_0, input->keybit);
410 input->absmax[ABS_DISTANCE] = 32; 403 __set_bit(BTN_1, input->keybit);
404 __set_bit(BTN_TOOL_FINGER, input->keybit);
411 405
412 input->absmax[ABS_X] = 16704; 406 /* Distance, rubber and mouse */
413 input->absmax[ABS_Y] = 12064; 407 __set_bit(BTN_TOOL_RUBBER, input->keybit);
414 input->absfuzz[ABS_X] = 4; 408 __set_bit(BTN_TOOL_MOUSE, input->keybit);
415 input->absfuzz[ABS_Y] = 4; 409
410 input_set_abs_params(input, ABS_X, 0, 16704, 4, 0);
411 input_set_abs_params(input, ABS_Y, 0, 12064, 4, 0);
412 input_set_abs_params(input, ABS_PRESSURE, 0, 511, 0, 0);
413 input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
416 414
417 return 0; 415 return 0;
416
418err_free: 417err_free:
419 kfree(wdata); 418 kfree(wdata);
420 return ret; 419 return ret;