mirror of
https://github.com/armbian/build.git
synced 2025-08-15 07:36:57 +02:00
59 lines
2.5 KiB
Diff
59 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Nicola Guerrera <guerrera.nicola@gmail.com>
|
|
Date: Thu, 14 Nov 2024 22:57:02 +0100
|
|
Subject: nt36xxx: add pen input resolution
|
|
|
|
---
|
|
drivers/input/touchscreen/nt36523/nt36xxx.c | 15 +++++++---
|
|
drivers/input/touchscreen/nt36523/nt36xxx.h | 4 ++-
|
|
2 files changed, 14 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/drivers/input/touchscreen/nt36523/nt36xxx.c b/drivers/input/touchscreen/nt36523/nt36xxx.c
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/input/touchscreen/nt36523/nt36xxx.c
|
|
+++ b/drivers/input/touchscreen/nt36523/nt36xxx.c
|
|
@@ -1421,14 +1421,21 @@ static int32_t nvt_ts_probe(struct spi_device *client)
|
|
ts->pen_input_dev->keybit[BIT_WORD(BTN_STYLUS2)] |= BIT_MASK(BTN_STYLUS2);
|
|
ts->pen_input_dev->propbit[0] = BIT(INPUT_PROP_DIRECT);
|
|
|
|
+ int x_max, y_max;
|
|
+
|
|
if (ts->wgp_stylus) {
|
|
- input_set_abs_params(ts->pen_input_dev, ABS_X, 0, ts->abs_x_max * 2 - 1, 0, 0);
|
|
- input_set_abs_params(ts->pen_input_dev, ABS_Y, 0, ts->abs_y_max * 2 - 1, 0, 0);
|
|
+ x_max = ts->abs_x_max * 2 - 1;
|
|
+ y_max = ts->abs_y_max * 2 - 1;
|
|
} else {
|
|
- input_set_abs_params(ts->pen_input_dev, ABS_X, 0, ts->abs_x_max - 1, 0, 0);
|
|
- input_set_abs_params(ts->pen_input_dev, ABS_Y, 0, ts->abs_y_max - 1, 0, 0);
|
|
+ x_max = ts->abs_x_max - 1;
|
|
+ y_max = ts->abs_y_max - 1;
|
|
}
|
|
|
|
+ input_set_abs_params(ts->pen_input_dev, ABS_X, 0, x_max, 0, 0);
|
|
+ input_set_abs_params(ts->pen_input_dev, ABS_Y, 0, y_max , 0, 0);
|
|
+ input_abs_set_res(ts->pen_input_dev, ABS_X, x_max / PANEL_DEFAULT_WIDTH_MM);
|
|
+ input_abs_set_res(ts->pen_input_dev, ABS_Y, y_max / PANEL_DEFAULT_HEIGHT_MM);
|
|
+
|
|
input_set_abs_params(ts->pen_input_dev, ABS_PRESSURE, 0, PEN_PRESSURE_MAX, 0, 0);
|
|
input_set_abs_params(ts->pen_input_dev, ABS_DISTANCE, 0, PEN_DISTANCE_MAX, 0, 0);
|
|
input_set_abs_params(ts->pen_input_dev, ABS_TILT_X, PEN_TILT_MIN, PEN_TILT_MAX, 0, 0);
|
|
diff --git a/drivers/input/touchscreen/nt36523/nt36xxx.h b/drivers/input/touchscreen/nt36523/nt36xxx.h
|
|
index 111111111111..222222222222 100644
|
|
--- a/drivers/input/touchscreen/nt36523/nt36xxx.h
|
|
+++ b/drivers/input/touchscreen/nt36523/nt36xxx.h
|
|
@@ -70,7 +70,9 @@ extern const uint16_t touch_key_array[TOUCH_KEY_NUM];
|
|
#define PEN_DISTANCE_MAX (1)
|
|
#define PEN_TILT_MIN (-60)
|
|
#define PEN_TILT_MAX (60)
|
|
-
|
|
+//---for pen resolution---
|
|
+#define PANEL_DEFAULT_WIDTH_MM 148 // 148mm
|
|
+#define PANEL_DEFAULT_HEIGHT_MM 237 // 237mm
|
|
/* Enable only when module have tp reset pin and connected to host */
|
|
#define NVT_TOUCH_SUPPORT_HW_RST 0
|
|
|
|
--
|
|
Armbian
|
|
|