touchscreen_mmi: do not lock in irq context

ts_mmi_touch_event_handler is running in irq context.
Do not wait mutex for long time.
If mutex can not get, just enable update baseline next time.

Change-Id: Ib943dfbebbd29e521c66360ff97d46ccc9dcb99f
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1572687
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2020-05-22 18:12:30 +08:00 • committed by Jialei Hao
commit 9231fb4a23

View file

@ -84,9 +84,11 @@ static int ts_mmi_touch_event_handler(struct touch_event_data *tev)
#endif
if (touch_cdev->pdata.fps_detection) {
if (touch_cdev->delay_baseline_update) {
TRY_TO_CALL(update_baseline, TS_MMI_UPDATE_BASELINE_ON);
if ((touch_cdev->delay_baseline_update) &&
mutex_trylock(&touch_cdev->method_mutex)) {
_TRY_TO_CALL(update_baseline, TS_MMI_UPDATE_BASELINE_ON);
touch_cdev->delay_baseline_update = false;
mutex_unlock(&touch_cdev->method_mutex);
}
}
break;