diff options
author | davidycchen <davidycchen@google.com> | 2022-04-11 12:55:06 +0800 |
---|---|---|
committer | Yen-Chao Chen <davidycchen@google.com> | 2022-04-11 05:11:05 +0000 |
commit | f15105e96ee6a44b4433832b93a26310d8fdfde4 (patch) | |
tree | 58cc5392f02c17fdd40196493ebe246c58a00492 | |
parent | d2e79c305280f59f613d4d7c981688aeb9aa9850 (diff) | |
download | synaptics_touch-f15105e96ee6a44b4433832b93a26310d8fdfde4.tar.gz |
synaptics: set dynamic motion filter as default.
Bug: 199104356
Test: Touch works normally.
Signed-off-by: davidycchen <davidycchen@google.com>
Change-Id: I943708f5c1adab3e20fe7f26f15ec54f5d0df668
-rw-r--r-- | syna_tcm2.c | 12 | ||||
-rw-r--r-- | syna_tcm2.h | 11 |
2 files changed, 17 insertions, 6 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c index 30eb9c2..5c19330 100644 --- a/syna_tcm2.c +++ b/syna_tcm2.c @@ -311,12 +311,12 @@ static int syna_update_motion_filter(struct syna_tcm *tcm, u8 touches) const u32 mf_timeout_ms = 500; u8 next_state; - if (tcm->mf_mode == 0) { + if (tcm->mf_mode == MF_OFF) { if (touches != 0) next_state = MF_UNFILTERED; else next_state = MF_FILTERED; - } else if (tcm->mf_mode == 1) { + } else if (tcm->mf_mode == MF_DYNAMIC) { /* Determine the next filter state. The motion filter is enabled by * default and it is disabled while a single finger is touching the * screen. If another finger is touched down or if a timeout expires, @@ -347,11 +347,11 @@ static int syna_update_motion_filter(struct syna_tcm *tcm, u8 touches) } break; } - } else if (tcm->mf_mode == 2) { + } else if (tcm->mf_mode == MF_ON) { next_state = MF_FILTERED; } else { - /* Set 0 as default when an invalid value is found. */ - tcm->mf_mode = 0; + /* Set 1(Dynamic) as default when an invalid value is found. */ + tcm->mf_mode = MF_DYNAMIC; return 0; } @@ -2776,7 +2776,7 @@ static int syna_dev_probe(struct platform_device *pdev) #endif /* init motion filter mode */ - tcm->mf_mode = 0; + tcm->mf_mode = MF_DYNAMIC; INIT_WORK(&tcm->motion_filter_work, syna_motion_filter_work); diff --git a/syna_tcm2.h b/syna_tcm2.h index bdf0daf..b37a1a9 100644 --- a/syna_tcm2.h +++ b/syna_tcm2.h @@ -312,6 +312,17 @@ typedef enum { MF_FILTERED_LOCKED = 2 } 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, +}; + #if defined(ENABLE_HELPER) /** * @brief: Tasks for helper |