summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2022-05-24 11:37:24 +0800
committerYen-Chao Chen <davidycchen@google.com>2022-05-25 03:37:09 +0000
commitdd6bc1f102d3285f3028199813182477d9a3d22e (patch)
treec930f81bfc477641edb08bf464b780367c80b6ea
parente3e6ba6f7d1e3ca7f60040643925048d7703af2f (diff)
downloadsynaptics_touch-dd6bc1f102d3285f3028199813182477d9a3d22e.tar.gz
synaptics: check touch status in work function
Skip to send any command when the touch is off. Bug: 233023888 Test: build pass and touch works. Signed-off-by: davidycchen <davidycchen@google.com> Change-Id: I4404714743e200a025a919df1d83dd60e5f7545b
-rw-r--r--syna_tcm2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c
index fdc48d5..5191f01 100644
--- a/syna_tcm2.c
+++ b/syna_tcm2.c
@@ -314,6 +314,11 @@ static void syna_motion_filter_work(struct work_struct *work)
{
struct syna_tcm *tcm = container_of(work, struct syna_tcm, motion_filter_work);
+ if (tcm->pwr_state != PWR_ON) {
+ LOGI("Touch is already off.");
+ return;
+ }
+
/* Send command to update filter state */
LOGD("setting motion filter = %s.\n",
tcm->set_continuously_report ? "false" : "true");
@@ -330,6 +335,11 @@ static void syna_set_report_rate_work(struct work_struct *work)
delayed_work = container_of(work, struct delayed_work, work);
tcm = container_of(delayed_work, struct syna_tcm, set_report_rate_work);
+ if (tcm->pwr_state != PWR_ON) {
+ LOGI("Touch is already off.");
+ return;
+ }
+
if (tcm->touch_count != 0) {
queue_delayed_work(tcm->event_wq, &tcm->set_report_rate_work,
msecs_to_jiffies(10));
@@ -399,6 +409,11 @@ static void syna_dev_helper_work(struct work_struct *work)
struct syna_tcm *tcm =
container_of(helper, struct syna_tcm, helper);
+ if (tcm->pwr_state != PWR_ON) {
+ LOGI("Touch is already off.");
+ goto exit;
+ }
+
task = ATOMIC_GET(helper->task);
switch (task) {
@@ -410,6 +425,7 @@ static void syna_dev_helper_work(struct work_struct *work)
break;
}
+exit:
ATOMIC_SET(helper->task, HELP_NONE);
}
#endif