mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
Report tapping coordinate when report gesture event
TP: Report tapping coordinate when report gesture event. Change-Id: Ifc3fc819850e72f77655c79621ade7e1f1dfdea7 Signed-off-by: Wenge Zhu <zhuwg1@motorola.com> Reviewed-on: https://gerrit.mot.com/2794123 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Deng <dengwei1@motorola.com> Reviewed-by: Jichao Zou <zoujc@motorola.com> Reviewed-by: Yeqing Wang <wangyq13@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
0769523d6e
commit
92a9e9ca3b
7 changed files with 21 additions and 6 deletions
|
|
@ -1479,10 +1479,8 @@ static int brl_event_handler(struct goodix_ts_core *cd,
|
|||
ts_event->event_type = EVENT_GESTURE;
|
||||
ts_event->gesture_report_info = pre_buf[2];
|
||||
ts_event->gesture_type = pre_buf[4];
|
||||
#ifdef CONFIG_GTP_FOD
|
||||
memcpy(ts_event->gesture_data, &pre_buf[8],
|
||||
GOODIX_GESTURE_DATA_LEN);
|
||||
#endif
|
||||
} else {
|
||||
ts_info("Unsupported event status");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -428,9 +428,7 @@ struct goodix_ts_event {
|
|||
u8 gesture_report_info;
|
||||
struct goodix_touch_data touch_data;
|
||||
struct goodix_pen_data pen_data;
|
||||
#ifdef CONFIG_GTP_FOD
|
||||
u8 gesture_data[GOODIX_GESTURE_DATA_LEN];
|
||||
#endif
|
||||
};
|
||||
|
||||
enum goodix_ic_bus_type {
|
||||
|
|
|
|||
|
|
@ -290,6 +290,8 @@ static int gsx_gesture_ist(struct goodix_ts_core *cd,
|
|||
mmi_event.evcode =4;
|
||||
}
|
||||
|
||||
mmi_event.evdata.x = le16_to_cpup((__le16 *)gs_event.gesture_data);
|
||||
mmi_event.evdata.y = le16_to_cpup((__le16 *)(gs_event.gesture_data + 2));
|
||||
/* call class method */
|
||||
ret = cd->imports->report_gesture(&mmi_event);
|
||||
if (!ret)
|
||||
|
|
|
|||
|
|
@ -419,6 +419,8 @@ static int gsx_gesture_ist(struct goodix_ts_core *cd,
|
|||
mmi_event.evcode =1;
|
||||
fod_down = 0;
|
||||
|
||||
mmi_event.evdata.x = le16_to_cpup((__le16 *)gs_event.gesture_data);
|
||||
mmi_event.evdata.y = le16_to_cpup((__le16 *)(gs_event.gesture_data + 2));
|
||||
/* call class method */
|
||||
ret = cd->imports->report_gesture(&mmi_event);
|
||||
if (!ret)
|
||||
|
|
@ -429,6 +431,8 @@ static int gsx_gesture_ist(struct goodix_ts_core *cd,
|
|||
mmi_event.evcode =4;
|
||||
fod_down = 0;
|
||||
|
||||
mmi_event.evdata.x = le16_to_cpup((__le16 *)gs_event.gesture_data);
|
||||
mmi_event.evdata.y = le16_to_cpup((__le16 *)(gs_event.gesture_data + 2));
|
||||
/* call class method */
|
||||
ret = cd->imports->report_gesture(&mmi_event);
|
||||
if (!ret)
|
||||
|
|
|
|||
|
|
@ -214,11 +214,18 @@ static int ts_mmi_gesture_handler(struct gesture_event_data *gev)
|
|||
int key_code;
|
||||
bool need2report = true;
|
||||
struct ts_mmi_dev *touch_cdev = sensor_pdata->touch_cdev;
|
||||
struct ts_mmi_dev_pdata *ppdata = &touch_cdev->pdata;
|
||||
|
||||
if (ppdata->resolution_boost) {
|
||||
gev->evdata.x /= ppdata->resolution_boost;
|
||||
gev->evdata.y /= ppdata->resolution_boost;
|
||||
}
|
||||
switch (gev->evcode) {
|
||||
case 1:
|
||||
key_code = BTN_TRIGGER_HAPPY3;
|
||||
pr_info("%s: single tap\n", __func__);
|
||||
input_report_abs(sensor_pdata->input_sensor_dev, ABS_X, gev->evdata.x);
|
||||
input_report_abs(sensor_pdata->input_sensor_dev, ABS_Y, gev->evdata.y);
|
||||
pr_info("%s: single tap; x=%d, y=%d\n", __func__, gev->evdata.x, gev->evdata.y);
|
||||
break;
|
||||
case 2:
|
||||
key_code = BTN_TRIGGER_HAPPY4;
|
||||
|
|
@ -236,7 +243,9 @@ static int ts_mmi_gesture_handler(struct gesture_event_data *gev)
|
|||
break;
|
||||
case 4:
|
||||
key_code = BTN_TRIGGER_HAPPY6;
|
||||
pr_info("%s: double tap\n", __func__);
|
||||
input_report_abs(sensor_pdata->input_sensor_dev, ABS_X, gev->evdata.x);
|
||||
input_report_abs(sensor_pdata->input_sensor_dev, ABS_Y, gev->evdata.y);
|
||||
pr_info("%s: double tap; x=%d, y=%d\n", __func__, gev->evdata.x, gev->evdata.y);
|
||||
break;
|
||||
default:
|
||||
need2report = false;
|
||||
|
|
|
|||
|
|
@ -186,6 +186,9 @@ int ts_mmi_parse_dt(struct ts_mmi_dev *touch_cdev,
|
|||
touch_cdev->clip.xBR, touch_cdev->clip.yBR);
|
||||
}
|
||||
|
||||
if (!of_property_read_u32(of_node, "mmi,resolution_boost", &ppdata->resolution_boost))
|
||||
dev_info(DEV_TS, "%s: resolution_boost = %d\n", __func__, ppdata->resolution_boost);
|
||||
|
||||
chosen = of_find_node_by_name(NULL, "chosen");
|
||||
if (chosen) {
|
||||
struct device_node *child;
|
||||
|
|
|
|||
|
|
@ -453,6 +453,7 @@ struct ts_mmi_dev_pdata {
|
|||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
int supported_gesture_type;
|
||||
#endif
|
||||
int resolution_boost;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue