touchscreen_mmi: exports touch events handler

1. Exports touch events handler in order to obtain the touch events
reported by vendor.
2. Add debug options to control whether to print log.

Change-Id: I3bb89cfe5c7a5a55ca01b3a93488558db4358445
Reviewed-on: https://gerrit.mot.com/1550603
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Tested-by: Jira Key
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong 2020-05-09 18:04:01 +08:00 • committed by litong20
commit 55d43ce7cd
4 changed files with 45 additions and 2 deletions

View file

@ -5,6 +5,10 @@ ifeq ($(DRM_DYNAMIC_REFRESH_RATE),true)
KERNEL_CFLAGS += CONFIG_DRM_DYNAMIC_REFRESH_RATE=y
endif
ifeq ($(TOUCHCLASS_MMI_DEBUG_INFO),true)
KERNEL_CFLAGS += CONFIG_TOUCHCLASS_MMI_DEBUG_INFO=y
endif
include $(CLEAR_VARS)
LOCAL_MODULE := touchscreen_mmi.ko
LOCAL_MODULE_TAGS := optional

View file

@ -8,6 +8,9 @@ endif
ifneq ($(filter m y, $(CONFIG_DRM_DYNAMIC_REFRESH_RATE)),)
EXTRA_CFLAGS += -DCONFIG_DRM_DYNAMIC_REFRESH_RATE
endif
ifneq ($(filter m y, $(CONFIG_TOUCHCLASS_MMI_DEBUG_INFO)),)
EXTRA_CFLAGS += -DCONFIG_TOUCHCLASS_MMI_DEBUG_INFO
endif
obj-m := touchscreen_mmi.o
touchscreen_mmi-objs := touchscreen_mmi_class.o touchscreen_mmi_panel.o touchscreen_mmi_notif.o touchscreen_mmi_gesture.o

View file

@ -60,6 +60,30 @@ static int ts_mmi_gesture_handler(struct gesture_event_data *gev)
return 0;
}
static int ts_mmi_touch_event_handler(struct touch_event_data *tev)
{
switch (tev->type) {
case TS_COORDINATE_ACTION_PRESS:
#if defined(CONFIG_TOUCHCLASS_MMI_DEBUG_INFO)
pr_info("%s: [P]Finger %d: Down, x=%d, y=%d, major=%d, minor=%d",
__func__, tev->id, tev->x, tev->y, tev->major, tev->minor);
#endif
break;
case TS_COORDINATE_ACTION_RELEASE:
#if defined(CONFIG_TOUCHCLASS_MMI_DEBUG_INFO)
pr_info("%s: [R]Finger %d: UP", __func__, tev->id);
#endif
break;
default:
pr_info("%s: unsupport type=%d\n", __func__, tev->type);
}
return 0;
}
bool ts_mmi_is_sensor_enable(void)
{
struct ts_mmi_dev *touch_cdev;
@ -156,6 +180,8 @@ int ts_mmi_gesture_init(struct ts_mmi_dev *touch_cdev)
/* export report gesture function to vendor */
touch_cdev->mdata->exports.report_gesture = ts_mmi_gesture_handler;
/* export report touch event function to vendor */
touch_cdev->mdata->exports.report_touch_event = ts_mmi_touch_event_handler;
return 0;

View file

@ -109,9 +109,18 @@ struct msm_drm_notifier *evdata = evd; \
#define TS_MMI_MAX_PANEL_LEN 16
#define TS_MMI_PILL_REGION_REQ_ARGS_NUM 3
enum touch_event_mode {
TS_COORDINATE_ACTION_NONE = 0,
TS_COORDINATE_ACTION_PRESS,
TS_COORDINATE_ACTION_RELEASE,
TS_COORDINATE_ACTION_MOVE
};
struct touch_event_data {
int type; /* TS_TOUCH, TS_RELEASE */
int x, y, w, p, m; /* X, Y, area, pressure and major */
enum touch_event_mode type; /* TS_TOUCH, TS_RELEASE */
int id; /* Finger id */
int x, y, w, p; /* X, Y, Area, Pressure */
int major, minor; /* Major, Minor */
};
struct gesture_event_data {
@ -129,6 +138,7 @@ struct gesture_event_data {
struct ts_mmi_class_methods {
int (*report_gesture)(struct gesture_event_data *gev);
int (*get_class_fname)(struct device *dev , const char **fname);
int (*report_touch_event)(struct touch_event_data *tev);
struct kobject *kobj_notify;
};