summaryrefslogtreecommitdiff
path: root/ft3658/focaltech_core.h
diff options
context:
space:
mode:
authorMason Wang <masonwang@google.com>2022-03-18 15:52:00 +0800
committerMason Wang <masonwang@google.com>2022-03-22 09:32:41 +0800
commit9317e79e4f3684367922ee70b92478445056965e (patch)
treecb5776cd332cc1caa187bcc6330d79b57a3cb23b /ft3658/focaltech_core.h
parent809e12eb80883e10eef33c863110dc480fa881ef (diff)
downloadfocaltech_touch-9317e79e4f3684367922ee70b92478445056965e.tar.gz
touch/focaltech: enable continuously touch reporting
Support dynamic changing motion filter status and continuously report touch coordinates and heatmap for 500ms when there is only one finger on the screen. Bug: 199105232 Test: Motion filter status is correct for single finger and multiple fingers. Signed-off-by: Mason Wang <masonwang@google.com> Change-Id: I90d0010c238cc789640fb1af72d0c90d94307fd7
Diffstat (limited to 'ft3658/focaltech_core.h')
-rw-r--r--ft3658/focaltech_core.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/ft3658/focaltech_core.h b/ft3658/focaltech_core.h
index 9372c0a..81679fc 100644
--- a/ft3658/focaltech_core.h
+++ b/ft3658/focaltech_core.h
@@ -182,6 +182,28 @@ struct pen_event {
int tool_type;
};
+/* Motion filter finite state machine (FSM) states
+ * MF_FILTERED - default coordinate filtering
+ * MF_UNFILTERED - unfiltered single-touch coordinates
+ * MF_FILTERED_LOCKED - filtered coordinates. Locked until touch is lifted.
+ */
+typedef enum {
+ MF_FILTERED,
+ MF_UNFILTERED,
+ MF_FILTERED_LOCKED,
+} motion_filter_state_t;
+
+/* Motion filter mode.
+ * MF_OFF : 0 = Always unfilter.
+ * MF_DYNAMIC: 1 = Dynamic change motion filter.
+ * MF_ON : 2 = Always filter by touch FW.
+ */
+enum MF_MODE {
+ MF_OFF,
+ MF_DYNAMIC,
+ MF_ON,
+};
+
struct fts_ts_data {
struct i2c_client *client;
struct spi_device *spi;
@@ -233,6 +255,22 @@ struct fts_ts_data {
int key_state;
int touch_point;
int point_num;
+
+ /* Motion filter mode.
+ * MF_OFF : 0 = Always unfilter.
+ * MF_DYNAMIC: 1 = Dynamic change motion filter.
+ * MF_ON : 2 = Always filter by touch FW.
+ */
+ u8 mf_mode;
+ /* Payload for continuously report. */
+ u16 set_continuously_report;
+ /* Motion filter finite state machine (FSM) state */
+ motion_filter_state_t mf_state;
+ /* Time of initial single-finger touch down. This timestamp is used to
+ * compute the duration a single finger is touched before it is lifted.
+ */
+ ktime_t mf_downtime;
+
#if IS_ENABLED(CONFIG_TOUCHSCREEN_HEATMAP)
bool enable_fw_heatmap;
#endif