diff options
| -rw-r--r-- | drivers/input/tablet/wacom_wac.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index f44c822caac8..367fa82a607e 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -1101,6 +1101,13 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
| 1101 | } | 1101 | } |
| 1102 | } | 1102 | } |
| 1103 | 1103 | ||
| 1104 | static unsigned int wacom_calculate_touch_res(unsigned int logical_max, | ||
| 1105 | unsigned int physical_max) | ||
| 1106 | { | ||
| 1107 | /* Touch physical dimensions are in 100th of mm */ | ||
| 1108 | return (logical_max * 100) / physical_max; | ||
| 1109 | } | ||
| 1110 | |||
| 1104 | void wacom_setup_input_capabilities(struct input_dev *input_dev, | 1111 | void wacom_setup_input_capabilities(struct input_dev *input_dev, |
| 1105 | struct wacom_wac *wacom_wac) | 1112 | struct wacom_wac *wacom_wac) |
| 1106 | { | 1113 | { |
| @@ -1228,8 +1235,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
| 1228 | case TABLETPC: | 1235 | case TABLETPC: |
| 1229 | if (features->device_type == BTN_TOOL_DOUBLETAP || | 1236 | if (features->device_type == BTN_TOOL_DOUBLETAP || |
| 1230 | features->device_type == BTN_TOOL_TRIPLETAP) { | 1237 | features->device_type == BTN_TOOL_TRIPLETAP) { |
| 1231 | input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0); | 1238 | input_abs_set_res(input_dev, ABS_X, |
| 1232 | input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0); | 1239 | wacom_calculate_touch_res(features->x_max, |
| 1240 | features->x_phy)); | ||
| 1241 | input_abs_set_res(input_dev, ABS_Y, | ||
| 1242 | wacom_calculate_touch_res(features->y_max, | ||
| 1243 | features->y_phy)); | ||
| 1233 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); | 1244 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); |
| 1234 | } | 1245 | } |
| 1235 | 1246 | ||
| @@ -1272,6 +1283,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
| 1272 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, | 1283 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, |
| 1273 | 0, features->pressure_max, | 1284 | 0, features->pressure_max, |
| 1274 | features->pressure_fuzz, 0); | 1285 | features->pressure_fuzz, 0); |
| 1286 | input_abs_set_res(input_dev, ABS_X, | ||
| 1287 | wacom_calculate_touch_res(features->x_max, | ||
| 1288 | features->x_phy)); | ||
| 1289 | input_abs_set_res(input_dev, ABS_Y, | ||
| 1290 | wacom_calculate_touch_res(features->y_max, | ||
| 1291 | features->y_phy)); | ||
| 1275 | } else if (features->device_type == BTN_TOOL_PEN) { | 1292 | } else if (features->device_type == BTN_TOOL_PEN) { |
| 1276 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); | 1293 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 1277 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); | 1294 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
