summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2020-06-08 12:04:08 +0800
committerDavid Chen <davidycchen@google.com>2020-06-08 10:02:37 +0000
commit3cda844bcb2212629d34872fe5fc5fd0e6e8194f (patch)
tree81362f411a98863972ed6f1434e7bf2d76a90d92
parent882233622bfe0e8ba70da62645c6fa429c763f20 (diff)
downloadfts_touch-3cda844bcb2212629d34872fe5fc5fd0e6e8194f.tar.gz
touch:fts: make spi bus resume before using it
For the new feature "touch palm support proximity sensor", there was a case that touch driver received interruprt during CPU suspended. Thus may cause the touch driver accessed the spi bus before the bus resumed and made spi hang. Disable the interrupt when CPU suspends during phone call and enables it back when the CPU wake up by irq so that the spi bus will be used after the bus driver resumes. Bug: 158262506 Test: Manually test. Change-Id: I5f08817589b69d34507e2781017a3257a421d79f Signed-off-by: davidycchen <davidycchen@google.com>
-rw-r--r--fts.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fts.c b/fts.c
index 1bf5c06..5a8151f 100644
--- a/fts.c
+++ b/fts.c
@@ -6196,8 +6196,11 @@ static int fts_pm_suspend(struct device *dev)
if (info->resume_bit == 1 || info->sensor_sleep == false) {
#ifdef SUPPORT_PROX_PALM
/* Don't block CPU suspend during phone call*/
- if (info->bus_refmask == FTS_BUS_REF_PHONE_CALL)
+ if (info->bus_refmask == FTS_BUS_REF_PHONE_CALL) {
+ fts_enableInterrupt(false);
+ enable_irq_wake(info->client->irq);
return 0;
+ }
#endif
pr_warn("%s: can't suspend because touch bus is in use!\n",
__func__);
@@ -6209,6 +6212,13 @@ static int fts_pm_suspend(struct device *dev)
static int fts_pm_resume(struct device *dev)
{
+#ifdef SUPPORT_PROX_PALM
+ struct fts_ts_info *info = dev_get_drvdata(dev);
+ if (info->bus_refmask == FTS_BUS_REF_PHONE_CALL) {
+ fts_enableInterrupt(true);
+ disable_irq_wake(info->client->irq);
+ }
+#endif
return 0;
}