Revert "(CR) nova_0flash_mmi: log touch down event timestamp"

This reverts commit 46abea9fb423a06c294ca7612ae11708561dc485.
this change has broken the multi point function

Change-Id: Idc9e912912bbd5a520f8b6d1ba8889820f0a6cad
Reviewed-on: https://gerrit.mot.com/2199829
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Wei Deng 2022-02-23 20:28:00 -06:00
commit c7f3fe6980
3 changed files with 6 additions and 39 deletions

View file

@ -1670,7 +1670,6 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
uint8_t input_id = 0;
#if MT_PROTOCOL_B
uint8_t press_id[TOUCH_MAX_FINGER_NUM] = {0};
static uint8_t touchdown[TOUCH_MAX_FINGER_NUM];
#endif /* MT_PROTOCOL_B */
int32_t i = 0;
int32_t finger_cnt = 0;
@ -1827,21 +1826,14 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
if (input_p == 0)
input_p = 1;
press_id[input_id - 1] = 1;
/* log touch down event once */
if (touchdown[input_id - 1] == 0) {
#if MT_PROTOCOL_B
ts->last_event_time = ktime_get();
pr_debug("TOUCH: [%d] logged timestamp\n", input_id - 1);
touchdown[input_id - 1] = 1;
pr_debug("TOUCH: [%d] pressed (event %d)\n", input_id - 1, point_data[position] & 0x07);
input_mt_slot(ts->input_dev, input_id - 1);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
press_id[input_id - 1] = 1;
input_mt_slot(ts->input_dev, input_id - 1);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
#else /* MT_PROTOCOL_B */
input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, input_id - 1);
input_report_key(ts->input_dev, BTN_TOUCH, 1);
input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, input_id - 1);
input_report_key(ts->input_dev, BTN_TOUCH, 1);
#endif /* MT_PROTOCOL_B */
}
#ifdef PALM_GESTURE
if((point_data[position] & 0x07) == PALM_TOUCH) { //palm
@ -1876,7 +1868,7 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
#if MT_PROTOCOL_B
for (i = 0; i < ts->max_touch_num; i++) {
if (!press_id[i] && touchdown[i]) {
if (press_id[i] != 1) {
input_mt_slot(ts->input_dev, i);
#ifdef PALM_GESTURE_RANGE
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR, 0);
@ -1885,8 +1877,6 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0);
input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 0);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, false);
touchdown[i] = 0;
pr_debug("TOUCH: [%d] release\n", i);
}
}

View file

@ -24,7 +24,6 @@
#include <linux/spi/spi.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#include <linux/ktime.h>
#include <linux/mmi_kernel_common.h>
#ifdef NVT_SENSOR_EN
@ -280,7 +279,6 @@ struct nvt_ts_data {
uint8_t edge_cmd[3]; /* /< edge switching command */
uint8_t rotate_cmd; /* /< rotate switching command */
bool edge_ctrl; /* /< edge rate switching */
ktime_t last_event_time;
};
#if NVT_TOUCH_PROC

View file

@ -41,8 +41,6 @@ static ssize_t nvt_mmi_edge_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size);
static ssize_t nvt_mmi_edge_show(struct device *dev,
struct device_attribute *attr, char *buf);
static ssize_t nvt_mmi_timestamp_show(struct device *dev,
struct device_attribute *attr, char *buf);
static DEVICE_ATTR(interpolation, (S_IRUGO | S_IWUSR | S_IWGRP),
nvt_mmi_interpolation_show, nvt_mmi_interpolation_store);
@ -52,7 +50,6 @@ static DEVICE_ATTR(jitter, (S_IRUGO | S_IWUSR | S_IWGRP),
nvt_mmi_jitter_show, nvt_mmi_jitter_store);
static DEVICE_ATTR(edge, (S_IRUGO | S_IWUSR | S_IWGRP),
nvt_mmi_edge_show, nvt_mmi_edge_store);
static DEVICE_ATTR(timestamp, S_IRUGO, nvt_mmi_timestamp_show, NULL);
#define MAX_ATTRS_ENTRIES 10
#define UI_FEATURE_ENABLE 1
@ -103,8 +100,6 @@ static int nvt_mmi_extend_attribute_group(struct device *dev, struct attribute_g
if (ts->edge_ctrl)
ADD_ATTR(edge);
ADD_ATTR(timestamp);
if (idx) {
ext_attributes[idx] = NULL;
*group = &ext_attr_group;
@ -194,22 +189,6 @@ static ssize_t nvt_mmi_interpolation_show(struct device *dev,
return scnprintf(buf, PAGE_SIZE, "0x%02x\n", ts->interpolation_cmd[0]);
}
static ssize_t nvt_mmi_timestamp_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
ktime_t last_ktime;
struct timespec64 last_ts;
mutex_lock(&ts->lock);
last_ktime = ts->last_event_time;
ts->last_event_time = 0;
mutex_unlock(&ts->lock);
last_ts = ktime_to_timespec64(last_ktime);
return scnprintf(buf, PAGE_SIZE, "%lld.%ld\n", last_ts.tv_sec, last_ts.tv_nsec);
}
static ssize_t nvt_mmi_jitter_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{