diff options
author | Yufeng Shen <miletus@chromium.org> | 2011-08-16 03:40:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-08-17 02:31:51 -0400 |
commit | 28ac293363368650963ee4c1e323c1ff502c121f (patch) | |
tree | 3abe4aed4be97b0d63dc4ae962e118fde563e15d /drivers | |
parent | c331eb580a0a7906c0cdb8dbae3cfe99e3c0e555 (diff) |
Input: atmel_mxt_ts - report pressure information from the driver
Atmel mxt1386 touch controller has the touch pressure information so
let's report it to the user space.
[dtor@mail.ru: added ABS_RESSURE reporting for ST emulation.]
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index ae00604a6a81..f5d66859f232 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -244,6 +244,7 @@ struct mxt_finger { | |||
244 | int x; | 244 | int x; |
245 | int y; | 245 | int y; |
246 | int area; | 246 | int area; |
247 | int pressure; | ||
247 | }; | 248 | }; |
248 | 249 | ||
249 | /* Each client has this additional data */ | 250 | /* Each client has this additional data */ |
@@ -536,6 +537,8 @@ static void mxt_input_report(struct mxt_data *data, int single_id) | |||
536 | finger[id].x); | 537 | finger[id].x); |
537 | input_report_abs(input_dev, ABS_MT_POSITION_Y, | 538 | input_report_abs(input_dev, ABS_MT_POSITION_Y, |
538 | finger[id].y); | 539 | finger[id].y); |
540 | input_report_abs(input_dev, ABS_MT_PRESSURE, | ||
541 | finger[id].pressure); | ||
539 | } else { | 542 | } else { |
540 | finger[id].status = 0; | 543 | finger[id].status = 0; |
541 | } | 544 | } |
@@ -546,6 +549,8 @@ static void mxt_input_report(struct mxt_data *data, int single_id) | |||
546 | if (status != MXT_RELEASE) { | 549 | if (status != MXT_RELEASE) { |
547 | input_report_abs(input_dev, ABS_X, finger[single_id].x); | 550 | input_report_abs(input_dev, ABS_X, finger[single_id].x); |
548 | input_report_abs(input_dev, ABS_Y, finger[single_id].y); | 551 | input_report_abs(input_dev, ABS_Y, finger[single_id].y); |
552 | input_report_abs(input_dev, | ||
553 | ABS_PRESSURE, finger[single_id].pressure); | ||
549 | } | 554 | } |
550 | 555 | ||
551 | input_sync(input_dev); | 556 | input_sync(input_dev); |
@@ -560,6 +565,7 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
560 | int x; | 565 | int x; |
561 | int y; | 566 | int y; |
562 | int area; | 567 | int area; |
568 | int pressure; | ||
563 | 569 | ||
564 | /* Check the touch is present on the screen */ | 570 | /* Check the touch is present on the screen */ |
565 | if (!(status & MXT_DETECT)) { | 571 | if (!(status & MXT_DETECT)) { |
@@ -584,6 +590,7 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
584 | y = y >> 2; | 590 | y = y >> 2; |
585 | 591 | ||
586 | area = message->message[4]; | 592 | area = message->message[4]; |
593 | pressure = message->message[5]; | ||
587 | 594 | ||
588 | dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, | 595 | dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, |
589 | status & MXT_MOVE ? "moved" : "pressed", | 596 | status & MXT_MOVE ? "moved" : "pressed", |
@@ -594,6 +601,7 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
594 | finger[id].x = x; | 601 | finger[id].x = x; |
595 | finger[id].y = y; | 602 | finger[id].y = y; |
596 | finger[id].area = area; | 603 | finger[id].area = area; |
604 | finger[id].pressure = pressure; | ||
597 | 605 | ||
598 | mxt_input_report(data, id); | 606 | mxt_input_report(data, id); |
599 | } | 607 | } |
@@ -1116,6 +1124,8 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1116 | 0, data->max_x, 0, 0); | 1124 | 0, data->max_x, 0, 0); |
1117 | input_set_abs_params(input_dev, ABS_Y, | 1125 | input_set_abs_params(input_dev, ABS_Y, |
1118 | 0, data->max_y, 0, 0); | 1126 | 0, data->max_y, 0, 0); |
1127 | input_set_abs_params(input_dev, ABS_PRESSURE, | ||
1128 | 0, 255, 0, 0); | ||
1119 | 1129 | ||
1120 | /* For multi touch */ | 1130 | /* For multi touch */ |
1121 | input_mt_init_slots(input_dev, MXT_MAX_FINGER); | 1131 | input_mt_init_slots(input_dev, MXT_MAX_FINGER); |
@@ -1125,6 +1135,8 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1125 | 0, data->max_x, 0, 0); | 1135 | 0, data->max_x, 0, 0); |
1126 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | 1136 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
1127 | 0, data->max_y, 0, 0); | 1137 | 0, data->max_y, 0, 0); |
1138 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, | ||
1139 | 0, 255, 0, 0); | ||
1128 | 1140 | ||
1129 | input_set_drvdata(input_dev, data); | 1141 | input_set_drvdata(input_dev, data); |
1130 | i2c_set_clientdata(client, data); | 1142 | i2c_set_clientdata(client, data); |