diff options
author | Ritesh Kumar <quic_riteshk@quicinc.com> | 2022-11-15 23:38:55 +0530 |
---|---|---|
committer | Ritesh Kumar <quic_riteshk@quicinc.com> | 2022-11-24 18:54:22 +0530 |
commit | 333d940f96f3201bf38108ad8f7225f10ea7e001 (patch) | |
tree | 71397240ac3fecbe5ccf74457d6e2f35e302c6ce | |
parent | ca51d4f514abe083bbcb05e530a1574f8a852a47 (diff) | |
download | touch-333d940f96f3201bf38108ad8f7225f10ea7e001.tar.gz |
touch: goodix: fix suspend resume sequence for dual touch case
Touch resume and suspend is done only when core_module_prob_sate
global variable is set to probed state. In case of dual touch,
if secondary probe fails, core_module_prob_sate is updated to
probe failed state. Due to this, suspend or resume calls for
primary touch returns early even though primary touch probe is
successful. This leads to primary touch remain always on.
To fix this, add a new ready variable in touch data structure
and perform suspend or resume operations when ready flag is
set to true.
Change-Id: I7b93a5b3135736caa3e2b5aaf6ff7d8adf4dee9d
Signed-off-by: Ritesh Kumar <quic_riteshk@quicinc.com>
-rw-r--r-- | goodix_berlin_driver/goodix_ts_core.c | 5 | ||||
-rw-r--r-- | goodix_berlin_driver/goodix_ts_core.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/goodix_berlin_driver/goodix_ts_core.c b/goodix_berlin_driver/goodix_ts_core.c index 4c2c079..e61fe7e 100644 --- a/goodix_berlin_driver/goodix_ts_core.c +++ b/goodix_berlin_driver/goodix_ts_core.c @@ -2298,7 +2298,7 @@ static int goodix_ts_suspend_helper(void *data) { struct goodix_ts_core *core_data = data; - if (!core_data || core_module_prob_sate != CORE_MODULE_PROB_SUCCESS) + if (!core_data || !core_data->ready) return 0; return goodix_ts_suspend(core_data); @@ -2308,7 +2308,7 @@ static int goodix_ts_resume_helper(void *data) { struct goodix_ts_core *core_data = data; - if (!core_data || core_module_prob_sate != CORE_MODULE_PROB_SUCCESS) + if (!core_data || !core_data->ready) return 0; return goodix_ts_resume(core_data); @@ -2590,6 +2590,7 @@ skip_to_power_gpio_setup: core_data->init_stage = CORE_INIT_STAGE1; goodix_modules.core_data = core_data; core_module_prob_sate = CORE_MODULE_PROB_SUCCESS; + core_data->ready = true; /* Try start a thread to get config-bin info */ goodix_start_later_init(core_data); diff --git a/goodix_berlin_driver/goodix_ts_core.h b/goodix_berlin_driver/goodix_ts_core.h index 929f965..debfdda 100644 --- a/goodix_berlin_driver/goodix_ts_core.h +++ b/goodix_berlin_driver/goodix_ts_core.h @@ -513,7 +513,7 @@ struct goodix_ts_core { struct notifier_block ts_notifier; struct goodix_ts_esd ts_esd; bool esd_initialized; - + bool ready; #if defined(CONFIG_DRM) struct notifier_block fb_notifier; void *notifier_cookie; |