mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
input: ili9882_mmi: add last_event_time function
ili9882_mmi: Add last event time function, record the last touch event time, used by phone back double tap. Change-Id: I793f79111c8a154074fd99c343d14b09df7c036b Signed-off-by: wangyq13 <wangyq13@lenovo.com> Reviewed-on: https://gerrit.mot.com/2417920 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jing Hu <hujing3@lenovo.com> Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
a7bc913a11
commit
1908fac4f7
5 changed files with 47 additions and 0 deletions
|
|
@ -59,6 +59,10 @@ ifeq ($(BOARD_USES_STYLUS_PALM),true)
|
|||
KBUILD_OPTIONS += CONFIG_ILITEK_PASSIVE_PEN=y
|
||||
endif
|
||||
|
||||
ifeq ($(TOUCHSCREEN_LAST_TIME),true)
|
||||
KBUILD_OPTIONS += CONFIG_ILI_TOUCH_LAST_TIME=y
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
ifneq ($(BOARD_USES_DOUBLE_TAP),)
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/sensors_class.ko
|
||||
|
|
|
|||
|
|
@ -56,6 +56,10 @@ ifneq ($(filter m y,$(CONFIG_ILITEK_PASSIVE_PEN)),)
|
|||
EXTRA_CFLAGS += -DILI_PASSIVE_PEN
|
||||
endif
|
||||
|
||||
ifneq ($(filter m y,$(CONFIG_ILI_TOUCH_LAST_TIME)),)
|
||||
EXTRA_CFLAGS += -DILI_TOUCH_LAST_TIME
|
||||
endif
|
||||
|
||||
ili9882_mmi-objs += ili9882.o
|
||||
ili9882_mmi-objs += ili9882_spi.o
|
||||
ili9882_mmi-objs += ili9882_qcom.o
|
||||
|
|
|
|||
|
|
@ -1037,6 +1037,9 @@ struct ilitek_ts_data {
|
|||
#if defined(CONFIG_INPUT_TOUCHSCREEN_MMI)
|
||||
struct ts_mmi_class_methods *imports;
|
||||
#endif
|
||||
#ifdef ILI_TOUCH_LAST_TIME
|
||||
ktime_t last_event_time;
|
||||
#endif
|
||||
};
|
||||
extern struct ilitek_ts_data *ilits;
|
||||
|
||||
|
|
|
|||
|
|
@ -946,6 +946,9 @@ void ili_touch_release_all_point(void)
|
|||
}
|
||||
|
||||
static struct ilitek_touch_info touch_info[MAX_TOUCH_NUM];
|
||||
#ifdef ILI_TOUCH_LAST_TIME
|
||||
static bool time_flag = 1;
|
||||
#endif
|
||||
|
||||
void ili_report_ap_mode(u8 *buf, int len)
|
||||
{
|
||||
|
|
@ -1021,6 +1024,13 @@ void ili_report_ap_mode(u8 *buf, int len)
|
|||
ILI_DBG("figner number = %d, LastTouch = %d\n", ilits->finger, ilits->last_touch);
|
||||
|
||||
if (ilits->finger) {
|
||||
#ifdef ILI_TOUCH_LAST_TIME
|
||||
if (time_flag) {
|
||||
ilits->last_event_time = ktime_get_boottime();
|
||||
time_flag = 0;
|
||||
ILI_DBG("set last_event_time\n");
|
||||
}
|
||||
#endif
|
||||
if (MT_B_TYPE) {
|
||||
for (i = 0; i < ilits->finger; i++) {
|
||||
input_report_key(ilits->input, BTN_TOUCH, 1);
|
||||
|
|
@ -1045,6 +1055,10 @@ void ili_report_ap_mode(u8 *buf, int len)
|
|||
ilits->last_touch = ilits->finger;
|
||||
} else {
|
||||
if (ilits->last_touch) {
|
||||
#ifdef ILI_TOUCH_LAST_TIME
|
||||
time_flag = 1;
|
||||
ILI_DBG("last touch, reset time_flag\n");
|
||||
#endif
|
||||
if (MT_B_TYPE) {
|
||||
for (i = 0; i < MAX_TOUCH_NUM; i++) {
|
||||
if (ilits->curt_touch[i] == 0 && ilits->prev_touch[i] == 1)
|
||||
|
|
|
|||
|
|
@ -131,6 +131,25 @@ static ssize_t ili_palm_settings_store(struct device *dev,
|
|||
return err;
|
||||
}
|
||||
|
||||
#ifdef ILI_TOUCH_LAST_TIME
|
||||
static ssize_t ili_mmi_timestamp_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
ktime_t last_ktime;
|
||||
struct timespec64 last_ts;
|
||||
|
||||
mutex_lock(&ilits->touch_mutex);
|
||||
last_ktime = ilits->last_event_time;
|
||||
ilits->last_event_time = 0;
|
||||
mutex_unlock(&ilits->touch_mutex);
|
||||
|
||||
last_ts = ktime_to_timespec64(last_ktime);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%lld.%ld\n", last_ts.tv_sec, last_ts.tv_nsec);
|
||||
}
|
||||
static DEVICE_ATTR(timestamp, S_IRUGO, ili_mmi_timestamp_show, NULL);
|
||||
#endif
|
||||
|
||||
static DEVICE_ATTR(palm_settings, S_IRUGO | S_IWUSR | S_IWGRP, ili_palm_settings_show, ili_palm_settings_store);
|
||||
|
||||
static int ili_mmi_extend_attribute_group(struct device *dev, struct attribute_group **group)
|
||||
|
|
@ -138,6 +157,9 @@ static int ili_mmi_extend_attribute_group(struct device *dev, struct attribute_g
|
|||
int idx = 0;
|
||||
|
||||
ADD_ATTR(palm_settings);
|
||||
#ifdef ILI_TOUCH_LAST_TIME
|
||||
ADD_ATTR(timestamp);
|
||||
#endif
|
||||
|
||||
if (idx) {
|
||||
ext_attributes[idx] = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue