diff options
author | Roger Liao <rogerliao@google.com> | 2020-06-24 18:47:34 +0800 |
---|---|---|
committer | Roger Liao <rogerliao@google.com> | 2020-06-24 18:47:50 +0800 |
commit | dddda0de70f1d5aaeff9aa768bbe9b78596e9c13 (patch) | |
tree | 3ddc67ea52ffc547ff7569b4c64c6db3b46f1dbc | |
parent | 5bf0a2155a7968e6ee2eb93c2162598005f4700c (diff) | |
parent | d32213bbaa4d99bff42b4e042c7992db957eb552 (diff) | |
download | fts_touch-dddda0de70f1d5aaeff9aa768bbe9b78596e9c13.tar.gz |
Merge branch 'android-msm-pixel-4.19' into android-msm-barbet-4.19
Merge from build 6619817
Align to LA.UM.9.12.R2.10.00.00.685.014
Bug: 159778850
Signed-off-by: Roger Liao <rogerliao@google.com>
Change-Id: I2a892cc43465215ab80c48c540fd8fcc3159ad9f
-rw-r--r-- | fts.c | 21 | ||||
-rw-r--r-- | fts.h | 1 |
2 files changed, 20 insertions, 2 deletions
@@ -5165,6 +5165,15 @@ int fts_set_bus_ref(struct fts_ts_info *info, u16 ref, bool enable) return ERROR_OP_NOT_ALLOW; } +#ifdef SUPPORT_PROX_PALM + if (enable && ref == FTS_BUS_REF_IRQ && + info->pm_suspend_during_phone_call) { + __pm_wakeup_event(info->wakesrc, jiffies_to_msecs(HZ)); + mutex_unlock(&info->bus_mutex); + return ERROR_OP_NOT_ALLOW; + } +#endif + if (enable) { /* IRQs can only keep the bus active. IRQs received while the * bus is transferred to SLPI should be ignored. @@ -6196,11 +6205,15 @@ 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*/ + mutex_lock(&info->bus_mutex); if (info->bus_refmask == FTS_BUS_REF_PHONE_CALL) { fts_enableInterrupt(false); enable_irq_wake(info->client->irq); + info->pm_suspend_during_phone_call = true; + mutex_unlock(&info->bus_mutex); return 0; } + mutex_unlock(&info->bus_mutex); #endif pr_warn("%s: can't suspend because touch bus is in use!\n", __func__); @@ -6214,10 +6227,14 @@ 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); + mutex_lock(&info->bus_mutex); + if (info->pm_suspend_during_phone_call) { + if (info->bus_refmask != 0) + fts_enableInterrupt(true); disable_irq_wake(info->client->irq); + info->pm_suspend_during_phone_call = false; } + mutex_unlock(&info->bus_mutex); #endif return 0; } @@ -480,6 +480,7 @@ struct fts_ts_info { #ifdef SUPPORT_PROX_PALM int audio_status; int prox_palm_status; + bool pm_suspend_during_phone_call; #endif /* Stop changing motion filter and keep fw design */ bool use_default_mf; |