mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
Syna: Modify the baseline update process
When the FPS is in the monitoring state, the baseline is not updated when touchscrenn resume. Change-Id: I115403a961504a7a73b625f32a8c1c64e90d99a5 Reviewed-on: https://gerrit.mot.com/1572727 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jialei Hao <haojl2@motorola.com> Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
9231fb4a23
commit
b223dd7e9e
3 changed files with 54 additions and 5 deletions
|
|
@ -3284,6 +3284,15 @@ static void syna_tcm_helper_work(struct work_struct *work)
|
|||
case HELP_SEND_ROMBOOT_HDL:
|
||||
syna_tcm_check_hdl(tcm_hcd, REPORT_HDL_ROMBOOT);
|
||||
break;
|
||||
|
||||
case HELP_SEND_REZERO_COMMAND:
|
||||
retval = syna_tcm_rezero(tcm_hcd);
|
||||
if (retval < 0) {
|
||||
LOGE(tcm_hcd->pdev->dev.parent,
|
||||
"Failed to re-zero for baseline update\n");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -3343,11 +3352,18 @@ int syna_tcm_resume(struct device *dev)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
retval = syna_tcm_rezero(tcm_hcd);
|
||||
if (retval < 0) {
|
||||
LOGE(tcm_hcd->pdev->dev.parent,
|
||||
"Failed to rezero\n");
|
||||
goto exit;
|
||||
/* When delay_baseline_update is true, the baseline is not updated,
|
||||
* so syna_tcm_rezero function is not run.
|
||||
*/
|
||||
if (!tcm_hcd->delay_baseline_update) {
|
||||
LOGD(tcm_hcd->pdev->dev.parent,
|
||||
"Enter into rezero function to update baseline \n");
|
||||
retval = syna_tcm_rezero(tcm_hcd);
|
||||
if (retval < 0) {
|
||||
LOGE(tcm_hcd->pdev->dev.parent,
|
||||
"Failed to rezero\n");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
goto mod_resume;
|
||||
|
|
|
|||
|
|
@ -340,6 +340,7 @@ enum helper_task {
|
|||
HELP_SEND_REINIT_NOTIFICATION,
|
||||
HELP_TOUCH_REINIT,
|
||||
HELP_SEND_ROMBOOT_HDL,
|
||||
HELP_SEND_REZERO_COMMAND,
|
||||
};
|
||||
|
||||
struct syna_tcm_helper {
|
||||
|
|
@ -460,6 +461,7 @@ struct syna_tcm_hcd {
|
|||
bool in_hdl_mode;
|
||||
bool is_detected;
|
||||
bool wakeup_gesture_enabled;
|
||||
bool delay_baseline_update;
|
||||
unsigned char sensor_type;
|
||||
unsigned char fb_ready;
|
||||
unsigned char command;
|
||||
|
|
|
|||
|
|
@ -685,6 +685,36 @@ exit:
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int syna_ts_mmi_update_baseline(struct device *dev, int mode)
|
||||
{
|
||||
struct syna_tcm_hcd *tcm_hcd;
|
||||
struct platform_device *pdev;
|
||||
int retval;
|
||||
|
||||
GET_SYNA_DATA(dev);
|
||||
|
||||
mutex_lock(&tcm_hcd->extif_mutex);
|
||||
|
||||
if (mode && tcm_hcd->delay_baseline_update) {
|
||||
if (atomic_read(&tcm_hcd->helper.task) == HELP_NONE) {
|
||||
dev_info(dev, "%s: Start to update baseline\n", __func__);
|
||||
atomic_set(&tcm_hcd->helper.task,
|
||||
HELP_SEND_REZERO_COMMAND);
|
||||
queue_work(tcm_hcd->helper.workqueue,
|
||||
&tcm_hcd->helper.work);
|
||||
} else {
|
||||
retval = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
retval = 0;
|
||||
tcm_hcd->delay_baseline_update = !mode;
|
||||
|
||||
exit:
|
||||
mutex_unlock(&tcm_hcd->extif_mutex);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static struct ts_mmi_methods syna_ts_mmi_methods = {
|
||||
.get_vendor = syna_ts_mmi_methods_get_vendor,
|
||||
.get_productinfo = syna_ts_mmi_methods_get_productinfo,
|
||||
|
|
@ -707,6 +737,7 @@ static struct ts_mmi_methods syna_ts_mmi_methods = {
|
|||
.suppression = syna_ts_mmi_methods_suppression,
|
||||
.gs_distance = syna_ts_mmi_methods_gs_distance,
|
||||
.pill_region = syna_ts_mmi_methods_pill_region,
|
||||
.update_baseline = syna_ts_mmi_update_baseline,
|
||||
.hold_distance = syna_ts_mmi_methods_hold_distance,
|
||||
/* Firmware */
|
||||
.firmware_update = syna_ts_firmware_update,
|
||||
|
|
|
|||
Loading…
Reference in a new issue