mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
himax: Compatible with the way of gesture to report key
- Since we noticed that some projects need to report not only one type of touch gesture and touch hal has been changed on bq branch, so if we still report instance the single tap should not be work properly. So add report function key to fit for the hal's change. Change-Id: I463c7ceb046836305b9c947eec6f79d321df7d92 Signed-off-by: wengjun1 <wengjun1@motorola.com> Reviewed-on: https://gerrit.mot.com/1538913 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted 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:
parent
6204f33cd5
commit
2f70e77a91
3 changed files with 27 additions and 5 deletions
|
|
@ -1551,11 +1551,19 @@ static void himax_wake_event_report(void)
|
|||
|
||||
if (KEY_EVENT) {
|
||||
#ifdef HIMAX_V2_SENSOR_EN
|
||||
input_report_abs(private_ts->sensor_pdata->input_sensor_dev, ABS_DISTANCE, ++report_cnt);
|
||||
if (private_ts->report_gesture_key) {
|
||||
input_report_key(private_ts->sensor_pdata->input_sensor_dev, KEY_F1, 1);
|
||||
input_sync(private_ts->sensor_pdata->input_sensor_dev);
|
||||
input_report_key(private_ts->sensor_pdata->input_sensor_dev, KEY_F1, 0);
|
||||
input_sync(private_ts->sensor_pdata->input_sensor_dev);
|
||||
++report_cnt;
|
||||
} else {
|
||||
input_report_abs(private_ts->sensor_pdata->input_sensor_dev, ABS_DISTANCE, ++report_cnt);
|
||||
input_sync(private_ts->sensor_pdata->input_sensor_dev);
|
||||
}
|
||||
I("input report: %d", report_cnt);
|
||||
if (report_cnt >= REPORT_MAX_COUNT)
|
||||
report_cnt = 0;
|
||||
input_sync(private_ts->sensor_pdata->input_sensor_dev);
|
||||
#else
|
||||
I(" %s SMART WAKEUP KEY event %d press\n", __func__, KEY_EVENT);
|
||||
input_report_key(private_ts->input_dev, KEY_EVENT, 1);
|
||||
|
|
@ -3072,10 +3080,16 @@ static int himax_tap_detect_sensor_init(struct himax_ts_data *data)
|
|||
}
|
||||
data->sensor_pdata = sensor_pdata;
|
||||
|
||||
__set_bit(EV_ABS, sensor_input_dev->evbit);
|
||||
__set_bit(EV_SYN, sensor_input_dev->evbit);
|
||||
input_set_abs_params(sensor_input_dev, ABS_DISTANCE,
|
||||
0, REPORT_MAX_COUNT, 0, 0);
|
||||
|
||||
if (data->report_gesture_key) {
|
||||
__set_bit(EV_KEY, sensor_input_dev->evbit);
|
||||
__set_bit(KEY_F1, sensor_input_dev->keybit);
|
||||
} else {
|
||||
__set_bit(EV_ABS, sensor_input_dev->evbit);
|
||||
input_set_abs_params(sensor_input_dev, ABS_DISTANCE,
|
||||
0, REPORT_MAX_COUNT, 0, 0);
|
||||
}
|
||||
sensor_input_dev->name = "double-tap";
|
||||
data->sensor_pdata->input_sensor_dev = sensor_input_dev;
|
||||
|
||||
|
|
|
|||
|
|
@ -430,6 +430,7 @@ struct himax_ts_data {
|
|||
int (*power)(int on);
|
||||
int pre_finger_data[10][2];
|
||||
bool vdd_1v8_always_on;
|
||||
uint32_t report_gesture_key;
|
||||
|
||||
struct device *dev;
|
||||
struct workqueue_struct *himax_wq;
|
||||
|
|
|
|||
|
|
@ -201,6 +201,13 @@ int himax_parse_dt(struct himax_ts_data *ts,
|
|||
I(" DT:vdd_1v8_always_on=%d\n", ts->vdd_1v8_always_on);
|
||||
}
|
||||
|
||||
if (of_property_read_bool(dt, "himax,report_gesture_key")) {
|
||||
I("novatek,report_gesture_key set");
|
||||
ts->report_gesture_key = 1;
|
||||
} else {
|
||||
ts->report_gesture_key = 0;
|
||||
}
|
||||
|
||||
himax_vk_parser(dt, pdata);
|
||||
|
||||
chosen = of_find_node_by_name(NULL, "chosen");
|
||||
|
|
|
|||
Loading…
Reference in a new issue