diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-12-29 01:03:37 +0000 |
---|---|---|
committer | Android Partner Code Review <android-gerrit-partner@google.com> | 2022-12-29 01:03:37 +0000 |
commit | f323bf3b045fdc177e9b9310eecadc4498ca62b0 (patch) | |
tree | 6ba70d6bc4b41eaec0b43ddb15cf10ec30733075 | |
parent | 8c9ad3cde7840102d5a8b794e298a69d4e28938c (diff) | |
parent | 58d5143eb59944cb3acf3e7469557a5e6b300209 (diff) | |
download | novatek_touch-f323bf3b045fdc177e9b9310eecadc4498ca62b0.tar.gz |
Merge "touch/novatek: support atrace for stylus input reporting." into android13-gs-pixel-5.10-tm-qpr2
-rw-r--r-- | nt36xxx/nt36xxx.c | 16 | ||||
-rw-r--r-- | nt36xxx/nt36xxx.h | 1 | ||||
-rw-r--r-- | nt36xxx/nt36xxx_goog.c | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/nt36xxx/nt36xxx.c b/nt36xxx/nt36xxx.c index 018ec3b..595956e 100644 --- a/nt36xxx/nt36xxx.c +++ b/nt36xxx/nt36xxx.c @@ -1727,6 +1727,8 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data) uint16_t pen_vid; uint16_t pen_pid; #endif + char trace_tag[128]; + ktime_t pen_ktime; if (!ts->probe_done) return IRQ_HANDLED; @@ -2004,6 +2006,12 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data) ts->pen_format_id = point_data[66]; if (ts->pen_format_id != 0xFF) { if (ts->pen_format_id == 0x01) { + pen_ktime = ktime_get(); + scnprintf(trace_tag, sizeof(trace_tag), + "stylus-active: TH %lld BH %lld delta %lld us\n", + ktime_to_us(ts->timestamp), ktime_to_us(pen_ktime), + ktime_us_delta(pen_ktime, ts->timestamp)); + ATRACE_BEGIN(trace_tag); // report pen data pen_x = (uint32_t)(point_data[67] << 8) + (uint32_t)(point_data[68]); pen_y = (uint32_t)(point_data[69] << 8) + (uint32_t)(point_data[70]); @@ -2068,6 +2076,7 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data) process_usi_responses(info_buf_flags, info_buf); } #endif + ATRACE_END(); } else if (ts->pen_format_id == 0xF0) { // report Pen ID } else { @@ -2075,6 +2084,12 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data) goto XFER_ERROR; } } else if (ts->pen_active) { // pen_format_id = 0xFF and a pen was reporting + pen_ktime = ktime_get(); + scnprintf(trace_tag, sizeof(trace_tag), + "stylus-inactive: TH %lld BH %lld delta %lld us\n", + ktime_to_us(ts->timestamp), ktime_to_us(pen_ktime), + ktime_us_delta(pen_ktime, ts->timestamp)); + ATRACE_BEGIN(trace_tag); input_set_timestamp(ts->pen_input_dev, ts->timestamp); /* Snapshot some stylus context information for offload */ @@ -2121,6 +2136,7 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data) nvt_usi_clear_stylus_read_map(); #endif + ATRACE_END(); } } /* if (ts->pen_support) */ diff --git a/nt36xxx/nt36xxx.h b/nt36xxx/nt36xxx.h index a3a47ad..920f3bc 100644 --- a/nt36xxx/nt36xxx.h +++ b/nt36xxx/nt36xxx.h @@ -30,6 +30,7 @@ #include <linux/earlysuspend.h> #endif +#include "../../../gs-google/drivers/soc/google/vh/kernel/systrace.h" #include "nt36xxx_mem_map.h" #ifdef CONFIG_MTK_SPI diff --git a/nt36xxx/nt36xxx_goog.c b/nt36xxx/nt36xxx_goog.c index bb8e67d..caca0bc 100644 --- a/nt36xxx/nt36xxx_goog.c +++ b/nt36xxx/nt36xxx_goog.c @@ -7,7 +7,6 @@ #include "nt36xxx.h" #include <linux/input/mt.h> #include <samsung/exynos_drm_connector.h> /* to_exynos_connector_state() */ -#include "../../../gs-google/drivers/soc/google/vh/kernel/systrace.h" void nvt_heatmap_decode( const uint8_t *in, const uint32_t in_sz, |