diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2011-04-13 02:18:59 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-04-13 02:34:21 -0400 |
commit | 8b86c1c28f569301aa1a113a060f9ed803300903 (patch) | |
tree | 6fda48ec421fa8f3861174db39e902b140391443 | |
parent | 08960a070add74cda8c968b8ace5418a5acf17c3 (diff) |
Input: atmel_mxt_ts - convert to MT protocol B
Atmel touchscreen chips can use MT protocol B because they can assign
unique id to ABS_MT_TRACKING_ID from finger id provided by hardware.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 2accf1dffee9..1e61387c73ca 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/firmware.h> | 17 | #include <linux/firmware.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/i2c/atmel_mxt_ts.h> | 19 | #include <linux/i2c/atmel_mxt_ts.h> |
20 | #include <linux/input.h> | 20 | #include <linux/input/mt.h> |
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | 23 | ||
@@ -504,19 +504,21 @@ static void mxt_input_report(struct mxt_data *data, int single_id) | |||
504 | if (!finger[id].status) | 504 | if (!finger[id].status) |
505 | continue; | 505 | continue; |
506 | 506 | ||
507 | input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, | 507 | input_mt_slot(input_dev, id); |
508 | finger[id].status != MXT_RELEASE ? | 508 | input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, |
509 | finger[id].area : 0); | 509 | finger[id].status != MXT_RELEASE); |
510 | input_report_abs(input_dev, ABS_MT_POSITION_X, | ||
511 | finger[id].x); | ||
512 | input_report_abs(input_dev, ABS_MT_POSITION_Y, | ||
513 | finger[id].y); | ||
514 | input_mt_sync(input_dev); | ||
515 | 510 | ||
516 | if (finger[id].status == MXT_RELEASE) | 511 | if (finger[id].status != MXT_RELEASE) { |
517 | finger[id].status = 0; | ||
518 | else | ||
519 | finger_num++; | 512 | finger_num++; |
513 | input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, | ||
514 | finger[id].area); | ||
515 | input_report_abs(input_dev, ABS_MT_POSITION_X, | ||
516 | finger[id].x); | ||
517 | input_report_abs(input_dev, ABS_MT_POSITION_Y, | ||
518 | finger[id].y); | ||
519 | } else { | ||
520 | finger[id].status = 0; | ||
521 | } | ||
520 | } | 522 | } |
521 | 523 | ||
522 | input_report_key(input_dev, BTN_TOUCH, finger_num > 0); | 524 | input_report_key(input_dev, BTN_TOUCH, finger_num > 0); |
@@ -1094,6 +1096,7 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1094 | 0, data->max_y, 0, 0); | 1096 | 0, data->max_y, 0, 0); |
1095 | 1097 | ||
1096 | /* For multi touch */ | 1098 | /* For multi touch */ |
1099 | input_mt_init_slots(input_dev, MXT_MAX_FINGER); | ||
1097 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | 1100 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, |
1098 | 0, MXT_MAX_AREA, 0, 0); | 1101 | 0, MXT_MAX_AREA, 0, 0); |
1099 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | 1102 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |