summaryrefslogtreecommitdiff
path: root/syna_tcm2.c
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2021-10-15 11:36:24 +0800
committerDavid Chen <davidycchen@google.com>2021-10-21 09:19:57 +0000
commitbf9731c028f5959aa4e80834bd5579c906b894b9 (patch)
tree368bc9e2cca3f68537aee65f4f339ff8a7fc37bc /syna_tcm2.c
parent89fea965cf3ec4f058d9f4dec13ddc583db43673 (diff)
downloadsynaptics_touch-bf9731c028f5959aa4e80834bd5579c906b894b9.tar.gz
synaptics: support more bus reference mode
Support force touch bus active and sysfs bus reference bit to make sure the touch bus is avtive while transferring SPI data. Bug: 199104466 Test: write the sysfs command successfully. Signed-off-by: davidycchen <davidycchen@google.com> Change-Id: Ic0ffe78917a749b5b1e9796972846b5e13440485
Diffstat (limited to 'syna_tcm2.c')
-rw-r--r--syna_tcm2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c
index f43d6cd..96f4606 100644
--- a/syna_tcm2.c
+++ b/syna_tcm2.c
@@ -1947,6 +1947,13 @@ static int syna_pm_suspend(struct device *dev)
if (tcm->pwr_state == PWR_ON) {
LOGW("can't suspend because touch bus is in use!\n");
+ if (tcm->bus_refmask == SYNA_BUS_REF_BUGREPORT &&
+ ktime_ms_delta(ktime_get(), tcm->bugreport_ktime_start) > 30 * MSEC_PER_SEC) {
+ syna_set_bus_ref(tcm, SYNA_BUS_REF_BUGREPORT, false);
+ pm_relax(&tcm->pdev->dev);
+ tcm->bugreport_ktime_start = 0;
+ LOGE("Force release SYNA_BUS_REF_BUGREPORT reference bit.");
+ }
return -EBUSY;
}