summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtif Niyaz <atifniyaz@google.com>2019-06-26 11:29:21 -0700
committerWilson Sung <wilsonsung@google.com>2019-08-21 17:44:43 +0800
commit6797766a34752ef0784bc52a48aadae2595236ec (patch)
tree140139b8283b26d7bfdd945458d40cc413c4fc07
parent01e962e9377e8a9b94761351c23e279a19f5ca00 (diff)
downloadfts_touch_s5-6797766a34752ef0784bc52a48aadae2595236ec.tar.gz
input: touchscreen: stm: Update usages of timestamp to use ktime_t
Bug: 119840121 Bug: 139785163 Change-Id: I98d073c72b2bd52563da9447679afa807fdd0a3e Signed-off-by: atifniyaz@google.com
-rw-r--r--fts.c12
-rw-r--r--fts.h3
2 files changed, 8 insertions, 7 deletions
diff --git a/fts.c b/fts.c
index 1958ce6..291ce49 100644
--- a/fts.c
+++ b/fts.c
@@ -144,7 +144,7 @@ static int fts_chip_initialization(struct fts_ts_info *info, int init_type);
static void fts_report_timestamp(struct fts_ts_info *info)
{
input_event(info->input_dev, EV_MSC, MSC_TIMESTAMP,
- info->timestamp / 1000);
+ ktime_to_ns(info->timestamp) / 1000);
}
/**
@@ -1507,7 +1507,7 @@ static void touchsim_work(struct work_struct *work)
struct fts_ts_info *info = container_of(touchsim,
struct fts_ts_info,
touchsim);
- u64 timestamp_ns = ktime_get_ns();
+ ktime_t timestamp = ktime_get();
/* prevent CPU from entering deep sleep */
pm_qos_update_request(&info->pm_qos_req, 100);
@@ -1523,11 +1523,11 @@ static void touchsim_work(struct work_struct *work)
touchsim->x, touchsim->y, 1);
input_event(info->input_dev, EV_MSC, MSC_TIMESTAMP,
- timestamp_ns / 1000);
+ ktime_to_ns(timestamp) / 1000);
input_sync(info->input_dev);
- heatmap_read(&info->v4l2, timestamp_ns);
+ heatmap_read(&info->v4l2, ktime_to_ns(timestamp));
pm_qos_update_request(&info->pm_qos_req, PM_QOS_DEFAULT_VALUE);
}
@@ -3929,7 +3929,7 @@ static irqreturn_t fts_interrupt_handler(int irq, void *handle)
input_sync(info->input_dev);
if (processed_pointer_event)
- heatmap_read(&info->v4l2, info->timestamp);
+ heatmap_read(&info->v4l2, ktime_to_ns(info->timestamp));
/* Disable the firmware motion filter during single touch */
update_motion_filter(info);
@@ -4397,7 +4397,7 @@ static irqreturn_t fts_isr(int irq, void *handle)
{
struct fts_ts_info *info = handle;
- info->timestamp = ktime_get_ns();
+ info->timestamp = ktime_get();
return IRQ_WAKE_THREAD;
}
diff --git a/fts.h b/fts.h
index 68f8ded..178bf07 100644
--- a/fts.h
+++ b/fts.h
@@ -412,7 +412,8 @@ struct fts_ts_info {
unsigned long stylus_id; /* Bitmask for the stylus */
#endif
- u64 timestamp; /* nanoseconds, acquired during hard interrupt */
+ ktime_t timestamp; /* time that the event was first received from the
+ touch IC, acquired during hard interrupt, in CLOCK_MONOTONIC */
struct fts_hw_platform_data *board; /* HW info from device tree */
struct regulator *vdd_reg; /* DVDD power regulator */