summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWendly Li <wendlyli@google.com>2022-05-16 17:22:03 +0000
committerWendly Li <wendlyli@google.com>2022-05-24 13:08:50 +0000
commit6afb5c204b55caaa2c87d5600b285c26bc61670f (patch)
treecaf80fa97efedf7b8bd0e820b840fdd395a4bc96
parent0a2c9717c36396bf882e2d8ac48b72309f20a458 (diff)
downloadgoodix_touch-6afb5c204b55caaa2c87d5600b285c26bc61670f.tar.gz
goodix: Switch to GTI's motion filter
Bug: 214118837 Test: Check mf_mode node exists Change-Id: I0337aaa8633e786c2cbd571179a2b4adb5d48a06 Signed-off-by: Wendly Li <wendlyli@google.com>
-rw-r--r--Makefile2
-rw-r--r--goodix_ts_core.c12
-rw-r--r--touch_apis.c6
-rw-r--r--touch_apis.h4
4 files changed, 23 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9d89bde..0bde15d 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ KBUILD_OPTIONS += CONFIG_TOUCHSCREEN_GOODIX_BRL=m
EXTRA_CFLAGS += -DDYNAMIC_DEBUG_MODULE
EXTRA_CFLAGS += -DCONFIG_TOUCHSCREEN_GOODIX_BRL_SPI
EXTRA_CFLAGS += -DCONFIG_TOUCHSCREEN_PM
-EXTRA_CFLAGS += -DCONFIG_TOUCHSCREEN_MOTION_FILTER
+#EXTRA_CFLAGS += -DCONFIG_TOUCHSCREEN_MOTION_FILTER
#EXTRA_CFLAGS += -DCONFIG_TOUCHSCREEN_TBN
EXTRA_CFLAGS += -DCONFIG_GOOG_TOUCH_INTERFACE
EXTRA_CFLAGS += -I$(KERNEL_SRC)/../google-modules/display
diff --git a/goodix_ts_core.c b/goodix_ts_core.c
index 6b8815d..73ab4e7 100644
--- a/goodix_ts_core.c
+++ b/goodix_ts_core.c
@@ -876,6 +876,15 @@ static int get_self_sensor_data(
cmd->size = (tx + rx) * sizeof(uint16_t);
return 0;
}
+
+static int set_continuous_report(
+ void *private_data, struct gti_continuous_report_cmd *cmd)
+{
+ struct goodix_ts_core *cd = private_data;
+ return cd->hw_ops->set_continuously_report_enabled(cd,
+ cmd->setting == GTI_CONTINUOUS_REPORT_ENABLE);
+}
+
#endif
/* prosfs create */
@@ -2290,7 +2299,9 @@ int goodix_ts_stage2_init(struct goodix_ts_core *cd)
cd->apis_data.set_sensing_enabled = set_sensing_enabled;
cd->apis_data.get_wake_lock_state = get_wake_lock_state;
cd->apis_data.set_wake_lock_state = set_wake_lock_state;
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_MOTION_FILTER)
cd->apis_data.tmf = &cd->tmf;
+#endif
ret = touch_apis_init(&cd->pdev->dev, &cd->apis_data);
if (ret < 0) {
@@ -2303,6 +2314,7 @@ int goodix_ts_stage2_init(struct goodix_ts_core *cd)
sizeof(struct gti_optional_configuration), GFP_KERNEL);
options->get_mutual_sensor_data = get_mutual_sensor_data;
options->get_self_sensor_data = get_self_sensor_data;
+ options->set_continuous_report = set_continuous_report;
cd->gti = goog_touch_interface_probe(
cd, cd->bus->dev, cd->input_dev, gti_default_handler, options);
diff --git a/touch_apis.c b/touch_apis.c
index 58a62e3..319a043 100644
--- a/touch_apis.c
+++ b/touch_apis.c
@@ -124,6 +124,7 @@ static ssize_t list_scan_mode_show(
return ret;
}
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_MOTION_FILTER)
static ssize_t mf_mode_show(
struct device *dev, struct device_attribute *attr, char *buf)
{
@@ -155,6 +156,7 @@ static ssize_t mf_mode_store(struct device *dev, struct device_attribute *attr,
apis->mf_mode = mode;
return count;
}
+#endif
static ssize_t ping_show(
struct device *dev, struct device_attribute *attr, char *buf)
@@ -339,7 +341,9 @@ static DEVICE_ATTR_RO(fw_ver);
static DEVICE_ATTR_RO(help);
static DEVICE_ATTR_RW(irq_enabled);
static DEVICE_ATTR_RO(list_scan_mode);
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_MOTION_FILTER)
static DEVICE_ATTR_RW(mf_mode);
+#endif
static DEVICE_ATTR_RO(ping);
static DEVICE_ATTR_RW(reset);
static DEVICE_ATTR_RW(scan_mode);
@@ -351,7 +355,9 @@ static struct attribute *sysfs_attrs[] = {
&dev_attr_help.attr,
&dev_attr_irq_enabled.attr,
&dev_attr_list_scan_mode.attr,
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_MOTION_FILTER)
&dev_attr_mf_mode.attr,
+#endif
&dev_attr_ping.attr,
&dev_attr_reset.attr,
&dev_attr_scan_mode.attr,
diff --git a/touch_apis.h b/touch_apis.h
index d1a501f..18b7528 100644
--- a/touch_apis.h
+++ b/touch_apis.h
@@ -8,7 +8,9 @@
#ifndef _TOUCH_APIS_H_
#define _TOUCH_APIS_H_
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_MOTION_FILTER)
#include "touch_mf_mode.h"
+#endif
#include "touch_pm.h"
enum scan_mode {
@@ -30,8 +32,10 @@ enum reset_result {
struct touch_apis_data {
int reset_result;
int scan_mode;
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_MOTION_FILTER)
struct touch_mf *tmf;
enum touch_mf_mode mf_mode;
+#endif
int (*get_fw_version)(struct device *dev, char *buf, size_t buf_size);
int (*get_irq_enabled)(struct device *dev);