From 3cda844bcb2212629d34872fe5fc5fd0e6e8194f Mon Sep 17 00:00:00 2001 From: davidycchen Date: Mon, 8 Jun 2020 12:04:08 +0800 Subject: 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 --- fts.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3