aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/wacom_w8001.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/wacom_w8001.c')
-rw-r--r--drivers/input/touchscreen/wacom_w8001.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index 5cb8449c909d..c14412ef4648 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -51,6 +51,10 @@ MODULE_LICENSE("GPL");
51#define W8001_PKTLEN_TPCCTL 11 /* control packet */ 51#define W8001_PKTLEN_TPCCTL 11 /* control packet */
52#define W8001_PKTLEN_TOUCH2FG 13 52#define W8001_PKTLEN_TOUCH2FG 13
53 53
54/* resolution in points/mm */
55#define W8001_PEN_RESOLUTION 100
56#define W8001_TOUCH_RESOLUTION 10
57
54struct w8001_coord { 58struct w8001_coord {
55 u8 rdy; 59 u8 rdy;
56 u8 tsw; 60 u8 tsw;
@@ -198,7 +202,7 @@ static void parse_touchquery(u8 *data, struct w8001_touch_query *query)
198 query->y = 1024; 202 query->y = 1024;
199 if (query->panel_res) 203 if (query->panel_res)
200 query->x = query->y = (1 << query->panel_res); 204 query->x = query->y = (1 << query->panel_res);
201 query->panel_res = 10; 205 query->panel_res = W8001_TOUCH_RESOLUTION;
202 } 206 }
203} 207}
204 208
@@ -394,6 +398,8 @@ static int w8001_setup(struct w8001 *w8001)
394 398
395 input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0); 399 input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0);
396 input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0); 400 input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0);
401 input_abs_set_res(dev, ABS_X, W8001_PEN_RESOLUTION);
402 input_abs_set_res(dev, ABS_Y, W8001_PEN_RESOLUTION);
397 input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0); 403 input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0);
398 if (coord.tilt_x && coord.tilt_y) { 404 if (coord.tilt_x && coord.tilt_y) {
399 input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0); 405 input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0);
@@ -418,14 +424,17 @@ static int w8001_setup(struct w8001 *w8001)
418 w8001->max_touch_x = touch.x; 424 w8001->max_touch_x = touch.x;
419 w8001->max_touch_y = touch.y; 425 w8001->max_touch_y = touch.y;
420 426
421 /* scale to pen maximum */
422 if (w8001->max_pen_x && w8001->max_pen_y) { 427 if (w8001->max_pen_x && w8001->max_pen_y) {
428 /* if pen is supported scale to pen maximum */
423 touch.x = w8001->max_pen_x; 429 touch.x = w8001->max_pen_x;
424 touch.y = w8001->max_pen_y; 430 touch.y = w8001->max_pen_y;
431 touch.panel_res = W8001_PEN_RESOLUTION;
425 } 432 }
426 433
427 input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0); 434 input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0);
428 input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0); 435 input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0);
436 input_abs_set_res(dev, ABS_X, touch.panel_res);
437 input_abs_set_res(dev, ABS_Y, touch.panel_res);
429 438
430 switch (touch.sensor_id) { 439 switch (touch.sensor_id) {
431 case 0: 440 case 0: