diff options
author | Wendly Li <wendlyli@google.com> | 2023-02-16 08:36:54 +0000 |
---|---|---|
committer | Wendly Li <wendlyli@google.com> | 2023-02-22 06:22:54 +0000 |
commit | 9a1bdd15f21249e755ef38ce2439e6ca407ca54c (patch) | |
tree | a96d3dee384d9ae7b5986e02425204a14a7b8eec /goodix_ts_core.c | |
parent | 01bc79a67eafe0013dbbb9843301e6e1ba8b97ac (diff) | |
download | goodix_touch-9a1bdd15f21249e755ef38ce2439e6ca407ca54c.tar.gz |
touch/goodix: fix double reset
ESD check will fail on firmware reset. When ESD check is failed, it will
reset firmware again. Skip ESD check to avoid double reset.
Double reset may cause self-test failure and other unexpected issues.
Bug: 267991839
Test: Check self-test works properly
Change-Id: I17063445e71832077766d3d9aa3e6457f4b9e4b7
Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'goodix_ts_core.c')
-rw-r--r-- | goodix_ts_core.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/goodix_ts_core.c b/goodix_ts_core.c index 7294aab..c86c0b7 100644 --- a/goodix_ts_core.c +++ b/goodix_ts_core.c @@ -1876,7 +1876,12 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data) } #endif - ts_esd->irq_status = true; + /* + * Since we received an interrupt from touch firmware, it means touch + * firmware is still alive. So skip esd check once. + */ + ts_esd->skip_once = true; + core_data->irq_trig_cnt++; /* inform external module */ mutex_lock(&goodix_modules.mutex); @@ -2290,7 +2295,7 @@ static void goodix_ts_esd_work(struct work_struct *work) const struct goodix_ts_hw_ops *hw_ops = cd->hw_ops; int ret = 0; - if (ts_esd->irq_status) + if (ts_esd->skip_once) goto exit; if (!atomic_read(&ts_esd->esd_on) || atomic_read(&cd->suspended)) @@ -2321,7 +2326,7 @@ static void goodix_ts_esd_work(struct work_struct *work) } exit: - ts_esd->irq_status = false; + ts_esd->skip_once = false; if (atomic_read(&ts_esd->esd_on)) schedule_delayed_work(&ts_esd->esd_work, 2 * HZ); } |