summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuper Liu <supercjliu@google.com>2022-12-05 00:26:47 +0000
committerSuper Liu <supercjliu@google.com>2022-12-05 06:10:58 +0000
commit0bc000489400f8f96bf08cb60ed6e1d684a46c2c (patch)
treed58dfe01be3651f901866ef5e8891ea47bcffcc5
parent71ea93f1d1f1a1d76d6aef51144f1a420ccdc644 (diff)
downloadnovatek_touch-0bc000489400f8f96bf08cb60ed6e1d684a46c2c.tar.gz
touch/novatek: refine codes for GTI disabled.
Bug: 260953606 Change-Id: I656581ce46d851ee11f31ecc0db30ba09aabcc70 Signed-off-by: Super Liu <supercjliu@google.com>
-rw-r--r--nt36xxx/nt36xxx.c13
-rw-r--r--nt36xxx/nt36xxx.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/nt36xxx/nt36xxx.c b/nt36xxx/nt36xxx.c
index 5670475..c1a63aa 100644
--- a/nt36xxx/nt36xxx.c
+++ b/nt36xxx/nt36xxx.c
@@ -2015,10 +2015,12 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
* offload
*/
ts->pen_active = 1;
+#ifdef GOOG_TOUCH_INTERFACE
ts->pen_offload_coord.status = COORD_STATUS_PEN;
ts->pen_offload_coord.x = pen_x;
ts->pen_offload_coord.y = pen_y;
ts->pen_offload_coord.pressure = pen_pressure;
+#endif
ts->pen_offload_coord_timestamp = ts->timestamp;
input_report_abs(ts->pen_input_dev, ABS_X, pen_x);
@@ -2067,9 +2069,10 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
/* Snapshot some stylus context information for offload */
ts->pen_active = 0;
ts->pen_offload_coord_timestamp = ts->timestamp;
+#ifdef GOOG_TOUCH_INTERFACE
memset(&ts->pen_offload_coord, 0,
sizeof(ts->pen_offload_coord));
-
+#endif
input_report_abs(ts->pen_input_dev, ABS_X, 0);
input_report_abs(ts->pen_input_dev, ABS_Y, 0);
input_report_abs(ts->pen_input_dev, ABS_PRESSURE, 0);
@@ -2579,9 +2582,15 @@ static int32_t nvt_ts_probe(struct spi_device *client)
if (client->irq) {
NVT_LOG("int_trigger_type=%d\n", ts->int_trigger_type);
ts->irq_enabled = true;
+#ifdef GOOG_TOUCH_INTERFACE
ret = goog_request_threaded_irq(ts->gti, client->irq,
nvt_ts_isr, nvt_ts_work_func,
ts->int_trigger_type | IRQF_ONESHOT, NVT_SPI_NAME, ts);
+#else
+ ret = request_threaded_irq(client->irq,
+ nvt_ts_isr, nvt_ts_work_func,
+ ts->int_trigger_type | IRQF_ONESHOT, NVT_SPI_NAME, ts);
+#endif
if (ret != 0) {
NVT_ERR("request irq failed. ret=%d\n", ret);
goto err_int_request_failed;
@@ -3098,8 +3107,10 @@ int nvt_ts_suspend(struct device *dev)
ts->pen_active = 0;
ts->pen_offload_coord_timestamp = ts->timestamp;
+#ifdef GOOG_TOUCH_INTERFACE
memset(&ts->pen_offload_coord, 0,
sizeof(ts->pen_offload_coord));
+#endif
#if NVT_TOUCH_EXT_USI
nvt_usi_clear_stylus_read_map();
#endif
diff --git a/nt36xxx/nt36xxx.h b/nt36xxx/nt36xxx.h
index 5583dc1..8c43cf8 100644
--- a/nt36xxx/nt36xxx.h
+++ b/nt36xxx/nt36xxx.h
@@ -336,7 +336,9 @@ struct nvt_ts_data {
/*
* Stylus context used by touch_offload
*/
+#ifdef GOOG_TOUCH_INTERFACE
struct TouchOffloadCoord pen_offload_coord;
+#endif
ktime_t pen_offload_coord_timestamp;
u8 pen_active;
};