summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2022-06-12 19:57:49 -0700
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2022-06-12 19:57:49 -0700
commit6856f8487ce306685c6541f5addfade0af21ecf8 (patch)
tree735672fe45f76db689a2cc5cf0bfadf3ef860725
parent3bf36bf107b6dbcad1b2855a87b923a6a076300a (diff)
parent1ae90fa9c4db5a427e821d4d19123969387a9f2c (diff)
downloadsynaptics_touch-6856f8487ce306685c6541f5addfade0af21ecf8.tar.gz
Merge android13-gs-pixel-5.10-tm-d1 into android13-gs-pixel-5.10-tm-qpr1
SBMerger: 442815275 Change-Id: I2a081f560fc8dfa80715600b637ab630495356bf Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--syna_tcm2.c24
-rw-r--r--syna_tcm2_platform.h2
-rw-r--r--syna_tcm2_platform_spi.c34
-rw-r--r--tcm/synaptics_touchcom_core_dev.h2
4 files changed, 58 insertions, 4 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c
index 5191f01..f610c6e 100644
--- a/syna_tcm2.c
+++ b/syna_tcm2.c
@@ -237,6 +237,16 @@ static void syna_dev_restore_feature_setting(struct syna_tcm *tcm, unsigned int
tcm->hw_if->compression_threhsold,
delay_ms_resp);
+ syna_tcm_set_dynamic_config(tcm->tcm_dev,
+ DC_GRIP_DELTA_THRESHOLD,
+ tcm->hw_if->grip_delta_threshold,
+ delay_ms_resp);
+
+ syna_tcm_set_dynamic_config(tcm->tcm_dev,
+ DC_GRIP_BORDER_THRESHOLD,
+ tcm->hw_if->grip_border_threshold,
+ delay_ms_resp);
+
if (tcm->hw_if->dynamic_report_rate) {
syna_tcm_set_dynamic_config(tcm->tcm_dev,
DC_REPORT_RATE_SWITCH,
@@ -1062,11 +1072,17 @@ static void syna_offload_set_running(struct syna_tcm *tcm, bool running)
}
/*
- * Disable firmware grip_suppression/palm_rejection when offload is running and
- * upper layer grip_suppression/palm_rejection is enabled.
+ * Use the configurations set by touch service if it's running.
+ * Enable the firmware grip and palm if the touch service isn't running.
*/
- next_enable_fw_grip = (running && (tcm->offload.config.filter_grip == 1)) ? 0 : 1;
- next_enable_fw_palm = (running && (tcm->offload.config.filter_palm == 1)) ? 0 : 1;
+ if (running) {
+ next_enable_fw_grip = tcm->offload.config.filter_grip;
+ next_enable_fw_palm = tcm->offload.config.filter_palm;
+ } else {
+ /* Enable the firmware grip and palm when touch */
+ next_enable_fw_grip = 1;
+ next_enable_fw_palm = 1;
+ }
if (next_enable_fw_grip != tcm->enable_fw_grip && tcm->enable_fw_grip < 2) {
tcm->enable_fw_grip = next_enable_fw_grip;
diff --git a/syna_tcm2_platform.h b/syna_tcm2_platform.h
index 8242d95..f411f65 100644
--- a/syna_tcm2_platform.h
+++ b/syna_tcm2_platform.h
@@ -148,6 +148,8 @@ struct syna_hw_interface {
const char *fw_name;
int pixels_per_mm;
u16 compression_threhsold;
+ u16 grip_delta_threshold;
+ u16 grip_border_threshold;
#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
u32 offload_id;
#endif
diff --git a/syna_tcm2_platform_spi.c b/syna_tcm2_platform_spi.c
index d0a4098..202efec 100644
--- a/syna_tcm2_platform_spi.c
+++ b/syna_tcm2_platform_spi.c
@@ -696,6 +696,40 @@ static int syna_spi_parse_dt(struct syna_hw_interface *hw_if,
hw_if->compression_threhsold = 15;
}
+ prop = of_find_property(np, "synaptics,grip-delta-threshold", NULL);
+ if (prop && prop->length) {
+ retval = of_property_read_u32(np, "synaptics,grip-delta-threshold",
+ &value);
+ if (retval < 0) {
+ LOGE("Fail to read synaptics,grip-delta-threshold\n");
+ return retval;
+ }
+
+ hw_if->grip_delta_threshold = value;
+ } else {
+ /*
+ * Set default as 50.
+ */
+ hw_if->grip_delta_threshold = 50;
+ }
+
+ prop = of_find_property(np, "synaptics,grip-border-threshold", NULL);
+ if (prop && prop->length) {
+ retval = of_property_read_u32(np, "synaptics,grip-border-threshold",
+ &value);
+ if (retval < 0) {
+ LOGE("Fail to read synaptics,grip-border-threshold\n");
+ return retval;
+ }
+
+ hw_if->grip_border_threshold = value;
+ } else {
+ /*
+ * Set default as 50.
+ */
+ hw_if->grip_border_threshold = 50;
+ }
+
hw_if->dynamic_report_rate = of_property_read_bool(np,"synaptics,dynamic-report-rate");
#if IS_ENABLED(CONFIG_TOUCHSCREEN_OFFLOAD)
diff --git a/tcm/synaptics_touchcom_core_dev.h b/tcm/synaptics_touchcom_core_dev.h
index c42607d..2031e49 100644
--- a/tcm/synaptics_touchcom_core_dev.h
+++ b/tcm/synaptics_touchcom_core_dev.h
@@ -231,6 +231,8 @@ enum dynamic_tcm_config_id {
DC_TOUCH_SCAN_MODE = 0xF2,
DC_ENABLE_PALM_REJECTION = 0xF3,
DC_CONTINUOUSLY_REPORT = 0xF5,
+ DC_GRIP_DELTA_THRESHOLD = 0xF6,
+ DC_GRIP_BORDER_THRESHOLD = 0xF7,
};
/**