dlkm: Improve himax_0flash_mmi for single tap

- Because sometimes the event of singe tap does not take long
enough for the upper layer to process, adding wakelock extends
the time for the system to enter sleep to ensure that every event
can be processed normally.

Change-Id: Ie01c83eb6d4331dc1ab38dd1d4e33fc3aae3a50f
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1594839
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqiu Huang <huangjq9@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wengjun1 2020-06-02 13:53:10 +08:00 • committed by Jun Weng
commit 477d824a1c
2 changed files with 21 additions and 0 deletions

View file

@ -1564,6 +1564,11 @@ static void himax_wake_event_report(void)
I("input report: %d", report_cnt);
if (report_cnt >= REPORT_MAX_COUNT)
report_cnt = 0;
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_timeout(&private_ts->tap_gesture_wakelock, msecs_to_jiffies(5000));
#else
__pm_wakeup_event(&private_ts->tap_gesture_wakelock, 5000);
#endif
#else
I(" %s SMART WAKEUP KEY event %d press\n", __func__, KEY_EVENT);
input_report_key(private_ts->input_dev, KEY_EVENT, 1);
@ -3108,6 +3113,12 @@ static int himax_tap_detect_sensor_init(struct himax_ts_data *data)
if (err)
goto unregister_sensor_input_device;
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_init(&data->tap_gesture_wakelock, WAKE_LOCK_SUSPEND, "dt-wake-lock");
#else
wakeup_source_init(&data->tap_gesture_wakelock, "dt-wake-lock");
#endif
return 0;
unregister_sensor_input_device:
@ -3127,6 +3138,11 @@ int himax_tap_detect_sensor_remove(struct himax_ts_data *data)
input_unregister_device(data->sensor_pdata->input_sensor_dev);
devm_kfree(&data->sensor_pdata->input_sensor_dev->dev,
data->sensor_pdata);
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_destroy(&data->tap_gesture_wakelock);
#else
wakeup_source_trash(&data->tap_gesture_wakelock);
#endif
data->sensor_pdata = NULL;
return 0;
}

View file

@ -542,6 +542,11 @@ struct himax_ts_data {
#ifdef HIMAX_V2_SENSOR_EN
struct himax_tap_sensor_platform_data *sensor_pdata;
#ifdef CONFIG_HAS_WAKELOCK
struct wake_lock tap_gesture_wakelock;
#else
struct wakeup_source tap_gesture_wakelock;
#endif
#endif
};