Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232432
b: refs/heads/master
c: 409550f
h: refs/heads/master
v: v3
  • Loading branch information
Ping Cheng authored and Dmitry Torokhov committed Jan 26, 2011
1 parent a3b1de7 commit 649299e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d38acb49b7368ac4e8ec0db0055155be0805db5d
refs/heads/master: 409550f2902470f0387fe40a7db441526e16b2c0
21 changes: 19 additions & 2 deletions trunk/drivers/input/tablet/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,13 @@ void wacom_setup_device_quirks(struct wacom_features *features)
}
}

static unsigned int wacom_calculate_touch_res(unsigned int logical_max,
unsigned int physical_max)
{
/* Touch physical dimensions are in 100th of mm */
return (logical_max * 100) / physical_max;
}

void wacom_setup_input_capabilities(struct input_dev *input_dev,
struct wacom_wac *wacom_wac)
{
Expand Down Expand Up @@ -1228,8 +1235,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
case TABLETPC:
if (features->device_type == BTN_TOOL_DOUBLETAP ||
features->device_type == BTN_TOOL_TRIPLETAP) {
input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
input_abs_set_res(input_dev, ABS_X,
wacom_calculate_touch_res(features->x_max,
features->x_phy));
input_abs_set_res(input_dev, ABS_Y,
wacom_calculate_touch_res(features->y_max,
features->y_phy));
__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
}

Expand Down Expand Up @@ -1272,6 +1283,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
input_set_abs_params(input_dev, ABS_MT_PRESSURE,
0, features->pressure_max,
features->pressure_fuzz, 0);
input_abs_set_res(input_dev, ABS_X,
wacom_calculate_touch_res(features->x_max,
features->x_phy));
input_abs_set_res(input_dev, ABS_Y,
wacom_calculate_touch_res(features->y_max,
features->y_phy));
} else if (features->device_type == BTN_TOOL_PEN) {
__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
__set_bit(BTN_TOOL_PEN, input_dev->keybit);
Expand Down

0 comments on commit 649299e

Please sign in to comment.