mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
focaltech_0flash_v2_mmi: single tap gesture not work fix
focaltech_0flash_v2_mmi fix single tap gesture feature, remove invalid gesture invoke Change-Id: I269a51346c40a4cc4409378342e29073d7e0acf6 Signed-off-by: hujing3 <hujing3@lenovo.com> Reviewed-on: https://gerrit.mot.com/2278143 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
9554e1f581
commit
45f76c2fcc
2 changed files with 19 additions and 18 deletions
|
|
@ -686,6 +686,7 @@ static int fts_read_touchdata(struct fts_ts_data *ts_data, u8 *buf)
|
|||
int ret = 0;
|
||||
|
||||
ts_data->touch_addr = 0x01;
|
||||
FTS_DEBUG("touch_size=%d", ts_data->touch_size);
|
||||
ret = fts_read(&ts_data->touch_addr, 1, buf, ts_data->touch_size);
|
||||
|
||||
if (((0xEF == buf[1]) && (0xEF == buf[2]) && (0xEF == buf[3]))
|
||||
|
|
@ -700,14 +701,6 @@ static int fts_read_touchdata(struct fts_ts_data *ts_data, u8 *buf)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if FTS_GESTURE_EN
|
||||
ret = fts_gesture_readdata(ts_data, buf + FTS_TOUCH_DATA_LEN);
|
||||
if (0 == ret) {
|
||||
FTS_INFO("succuss to get gesture data in irq handler");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -963,6 +956,7 @@ static int fts_irq_read_report(struct fts_ts_data *ts_data)
|
|||
|
||||
#if FTS_GESTURE_EN
|
||||
case TOUCH_GESTURE:
|
||||
FTS_DEBUG("handle TOUCH_GESTURE");
|
||||
if (0 == fts_gesture_readdata(ts_data, touch_buf)) {
|
||||
FTS_INFO("succuss to get gesture data in irq handler");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -340,16 +340,21 @@ static void fts_gesture_report(struct input_dev *input_dev, int gesture_id)
|
|||
FTS_INFO("Gesture got but wakeable not set. Skip this gesture.");
|
||||
return;
|
||||
}
|
||||
if (fts_data->pdata->report_gesture_key) {
|
||||
input_report_key(fts_data->sensor_pdata->input_sensor_dev, KEY_F1, 1);
|
||||
input_sync(fts_data->sensor_pdata->input_sensor_dev);
|
||||
input_report_key(fts_data->sensor_pdata->input_sensor_dev, KEY_F1, 0);
|
||||
input_sync(fts_data->sensor_pdata->input_sensor_dev);
|
||||
++report_cnt;
|
||||
} else {
|
||||
input_report_abs(fts_data->sensor_pdata->input_sensor_dev,
|
||||
ABS_DISTANCE, ++report_cnt);
|
||||
input_sync(fts_data->sensor_pdata->input_sensor_dev);
|
||||
|
||||
/* report single tap */
|
||||
if (gesture == KEY_GESTURE_U) {
|
||||
if (fts_data->pdata && fts_data->pdata->report_gesture_key) {
|
||||
FTS_DEBUG("report_gesture_key");
|
||||
input_report_key(fts_data->sensor_pdata->input_sensor_dev, KEY_F1, 1);
|
||||
input_sync(fts_data->sensor_pdata->input_sensor_dev);
|
||||
input_report_key(fts_data->sensor_pdata->input_sensor_dev, KEY_F1, 0);
|
||||
input_sync(fts_data->sensor_pdata->input_sensor_dev);
|
||||
++report_cnt;
|
||||
} else {
|
||||
input_report_abs(fts_data->sensor_pdata->input_sensor_dev,
|
||||
ABS_DISTANCE, ++report_cnt);
|
||||
input_sync(fts_data->sensor_pdata->input_sensor_dev);
|
||||
}
|
||||
}
|
||||
|
||||
FTS_INFO("input report: %d", report_cnt);
|
||||
|
|
@ -492,6 +497,7 @@ int fts_gesture_readdata(struct fts_ts_data *ts_data, u8 *touch_buf)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
FTS_FUNC_ENTER();
|
||||
if (ts_data->gesture_bmode == GESTURE_BM_TOUCH) {
|
||||
memcpy(buf, touch_buf + FTS_TOUCH_DATA_LEN, FTS_GESTURE_DATA_LEN);
|
||||
} else {
|
||||
|
|
@ -527,6 +533,7 @@ int fts_gesture_readdata(struct fts_ts_data *ts_data, u8 *touch_buf)
|
|||
|
||||
void fts_gesture_recovery(struct fts_ts_data *ts_data)
|
||||
{
|
||||
FTS_FUNC_ENTER();
|
||||
if (ts_data->gesture_support && (ENABLE == fts_gesture_data.active)) {
|
||||
FTS_DEBUG("gesture recovery...");
|
||||
fts_write_reg(0xD1, 0xFF);
|
||||
|
|
|
|||
Loading…
Reference in a new issue