diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_brl_hw.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_brl_hw.c index 885011598fdd..ae3a1b914f3a 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_brl_hw.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_brl_hw.c @@ -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; diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.h b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.h index d9d7357594bc..b05599e883bd 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.h +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.h @@ -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 { diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c index 0dc8d74dba87..44eacb470657 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture.c @@ -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) diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture_fod.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture_fod.c index 00c97dd9c4f2..874d4a28c9f6 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture_fod.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_gesture_fod.c @@ -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) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c index 1372b6b90511..816661e1532e 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_gesture.c @@ -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; diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c index 1b037dd32a1a..f5858b32d14e 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c @@ -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; diff --git a/include/linux/touchscreen_mmi.h b/include/linux/touchscreen_mmi.h index ccee2f10105e..4327bd9cc067 100644 --- a/include/linux/touchscreen_mmi.h +++ b/include/linux/touchscreen_mmi.h @@ -453,6 +453,7 @@ struct ts_mmi_dev_pdata { #ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL int supported_gesture_type; #endif + int resolution_boost; }; /**