diff options
author | Daniel Mack <daniel@caiaq.de> | 2010-08-02 20:15:17 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-08-02 20:29:56 -0700 |
commit | 987a6c0298260b7aa40702b349282554d6180e4b (patch) | |
tree | 29d0873435221a6d731267efc2412814440e4a28 /drivers/hid/hid-wacom.c | |
parent | 7957e9c4d175cc065f4277211fcb7d784fcee860 (diff) | |
download | linux-987a6c0298260b7aa40702b349282554d6180e4b.tar.bz2 |
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/hid-wacom.c')
-rw-r--r-- | drivers/hid/hid-wacom.c | 49 |
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, input_report_key(input, BTN_RIGHT, 0); input_report_key(input, BTN_MIDDLE, 0); input_report_abs(input, ABS_DISTANCE, - input->absmax[ABS_DISTANCE]); + input_abs_get_max(input, ABS_DISTANCE)); } else { input_report_key(input, BTN_TOUCH, 0); input_report_key(input, BTN_STYLUS, 0); @@ -383,38 +383,37 @@ move_on: /* Basics */ input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL); - input->absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | - BIT(ABS_PRESSURE) | BIT(ABS_DISTANCE); - input->relbit[0] |= BIT(REL_WHEEL); - set_bit(BTN_TOOL_PEN, input->keybit); - set_bit(BTN_TOUCH, input->keybit); - set_bit(BTN_STYLUS, input->keybit); - set_bit(BTN_STYLUS2, input->keybit); - set_bit(BTN_LEFT, input->keybit); - set_bit(BTN_RIGHT, input->keybit); - set_bit(BTN_MIDDLE, input->keybit); + + __set_bit(REL_WHEEL, input->relbit); + + __set_bit(BTN_TOOL_PEN, input->keybit); + __set_bit(BTN_TOUCH, input->keybit); + __set_bit(BTN_STYLUS, input->keybit); + __set_bit(BTN_STYLUS2, input->keybit); + __set_bit(BTN_LEFT, input->keybit); + __set_bit(BTN_RIGHT, input->keybit); + __set_bit(BTN_MIDDLE, input->keybit); /* Pad */ input->evbit[0] |= BIT(EV_MSC); - input->mscbit[0] |= BIT(MSC_SERIAL); - set_bit(BTN_0, input->keybit); - set_bit(BTN_1, input->keybit); - set_bit(BTN_TOOL_FINGER, input->keybit); - /* Distance, rubber and mouse */ - input->absbit[0] |= BIT(ABS_DISTANCE); - set_bit(BTN_TOOL_RUBBER, input->keybit); - set_bit(BTN_TOOL_MOUSE, input->keybit); + __set_bit(MSC_SERIAL, input->mscbit); - input->absmax[ABS_PRESSURE] = 511; - input->absmax[ABS_DISTANCE] = 32; + __set_bit(BTN_0, input->keybit); + __set_bit(BTN_1, input->keybit); + __set_bit(BTN_TOOL_FINGER, input->keybit); - input->absmax[ABS_X] = 16704; - input->absmax[ABS_Y] = 12064; - input->absfuzz[ABS_X] = 4; - input->absfuzz[ABS_Y] = 4; + /* Distance, rubber and mouse */ + __set_bit(BTN_TOOL_RUBBER, input->keybit); + __set_bit(BTN_TOOL_MOUSE, input->keybit); + + input_set_abs_params(input, ABS_X, 0, 16704, 4, 0); + input_set_abs_params(input, ABS_Y, 0, 12064, 4, 0); + input_set_abs_params(input, ABS_PRESSURE, 0, 511, 0, 0); + input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0); return 0; + err_free: kfree(wdata); return ret; |