summaryrefslogtreecommitdiff
path: root/fts.c
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2020-02-21 18:03:11 +0800
committerDavid Chen <davidycchen@google.com>2020-06-02 02:11:10 +0000
commit882233622bfe0e8ba70da62645c6fa429c763f20 (patch)
tree1c3dfd2be4a2f89899c70c7b6e6f2938c3a26c40 /fts.c
parentc5d37bc9006325d1724cb2cd1ef79d5f5f06fbed (diff)
downloadfts_touch-882233622bfe0e8ba70da62645c6fa429c763f20.tar.gz
touch:fts: support touch cancel mode
support to report MT_TOOL_PALM type for new cancel mode feature. Bug: 148993292 Test: use test firmware with the new feature. Change-Id: I1a14a219d2c44d4923e4d57ea742620d54b7457a Signed-off-by: davidycchen <davidycchen@google.com>
Diffstat (limited to 'fts.c')
-rw-r--r--fts.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/fts.c b/fts.c
index fe377c7..1bf5c06 100644
--- a/fts.c
+++ b/fts.c
@@ -176,6 +176,8 @@ void release_all_touches(struct fts_ts_info *info)
input_report_key(info->input_dev, BTN_TOUCH, 0);
input_sync(info->input_dev);
info->touch_id = 0;
+ info->palm_touch_mask = 0;
+ info->grip_touch_mask = 0;
#ifdef STYLUS_MODE
info->stylus_id = 0;
#endif
@@ -3040,13 +3042,32 @@ static bool fts_enter_pointer_event_handler(struct fts_ts_info *info, unsigned
* touch */
case TOUCH_TYPE_FINGER:
case TOUCH_TYPE_GLOVE:
+ pr_debug("%s : It is a touch type %d!\n", __func__, touchType);
+ if (info->palm_touch_mask)
+ tool = MT_TOOL_PALM;
+ else
+ tool = MT_TOOL_FINGER;
+ touch_condition = 1;
+ __set_bit(touchId, &info->touch_id);
+ __clear_bit(touchId, &info->palm_touch_mask);
+ __clear_bit(touchId, &info->grip_touch_mask);
+ break;
case TOUCH_TYPE_PALM:
pr_debug("%s : It is a touch type %d!\n", __func__, touchType);
- tool = MT_TOOL_FINGER;
+ tool = MT_TOOL_PALM;
touch_condition = 1;
__set_bit(touchId, &info->touch_id);
+ __set_bit(touchId, &info->palm_touch_mask);
+ __clear_bit(touchId, &info->grip_touch_mask);
+ break;
+ case TOUCH_TYPE_GRIP:
+ pr_debug("%s : It is a touch type %d!\n", __func__, touchType);
+ tool = MT_TOOL_PALM;
+ touch_condition = 1;
+ __set_bit(touchId, &info->touch_id);
+ __clear_bit(touchId, &info->palm_touch_mask);
+ __set_bit(touchId, &info->grip_touch_mask);
break;
-
case TOUCH_TYPE_HOVER:
tool = MT_TOOL_FINGER;
@@ -3125,9 +3146,13 @@ static bool fts_leave_pointer_event_handler(struct fts_ts_info *info, unsigned
/* pr_info("%s : It is a glove!\n", __func__); */
case TOUCH_TYPE_PALM:
/* pr_info("%s : It is a palm!\n", __func__); */
+ case TOUCH_TYPE_GRIP:
+ /* pr_info("%s : It is a grip!\n", __func__); */
case TOUCH_TYPE_HOVER:
tool = MT_TOOL_FINGER;
__clear_bit(touchId, &info->touch_id);
+ __clear_bit(touchId, &info->palm_touch_mask);
+ __clear_bit(touchId, &info->grip_touch_mask);
break;
default:
@@ -5831,6 +5856,8 @@ static int fts_probe(struct spi_device *client)
AREA_MAX, 0, 0);
input_set_abs_params(info->input_dev, ABS_MT_TOUCH_MINOR, AREA_MIN,
AREA_MAX, 0, 0);
+ input_set_abs_params(info->input_dev, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER,
+ MT_TOOL_FINGER, 0, 0);
#ifndef SKIP_PRESSURE
input_set_abs_params(info->input_dev, ABS_MT_PRESSURE, PRESSURE_MIN,
PRESSURE_MAX, 0, 0);
@@ -5902,6 +5929,8 @@ static int fts_probe(struct spi_device *client)
skip_5_1 = 1;
/* track slots */
info->touch_id = 0;
+ info->palm_touch_mask = 0;
+ info->grip_touch_mask = 0;
#ifdef STYLUS_MODE
info->stylus_id = 0;
#endif