Skip to contentSkip to conversation

ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties

PATCH In review Andreas Kemnade 1 participant 4 messages Oct 14, 2024 – Nov 11, 2024

Subsystems (4)
lore
Share & tools
lore

Andreas Kemnade

author maintainer
#0 lore raw

cover ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties

Specify touchscreen in a way that no userspace configuration is needed.

Note: if the devicetree patch is in without the input patch, things will be broken in a different way.

Andreas Kemnade (2):
Input: tsc2007 - accept standard properties
ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties

 arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi | 6 ++++--
 drivers/input/touchscreen/tsc2007.h        | 2 ++
 drivers/input/touchscreen/tsc2007_core.c   | 5 ++---
 3 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.39.2
author maintainer
#1 lore raw

PATCH 1/2 Input: tsc2007 - accept standard properties

Only some driver-specific properties were accepted, change it to use the now-available standard properties which are found in devicetrees containing this chip.

---
 drivers/input/touchscreen/tsc2007.h      | 2 ++
 drivers/input/touchscreen/tsc2007_core.c | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/input/touchscreen/tsc2007.h +2 -0
index 69b08dd6c8df1..e346fb4f75521 100644
@@ -19,6 +19,7 @@
 #ifndef _TSC2007_H
 #define _TSC2007_H
 
+#include <linux/input/touchscreen.h>
 struct gpio_desc;
 
 #define TSC2007_MEASURE_TEMP0		(0x0 << 4)
@@ -63,6 +64,7 @@ struct tsc2007 {
 
 	struct i2c_client	*client;
 
+	struct touchscreen_properties prop;
 	u16			model;
 	u16			x_plate_ohms;
 	u16			max_rt;
drivers/input/touchscreen/tsc2007_core.c +2 -3
index 8d832a372b897..5252301686ec6 100644
@@ -142,8 +142,7 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
 			rt = ts->max_rt - rt;
 
 			input_report_key(input, BTN_TOUCH, 1);
-			input_report_abs(input, ABS_X, tc.x);
-			input_report_abs(input, ABS_Y, tc.y);
+			touchscreen_report_pos(input, &ts->prop, tc.x, tc.y, false);
 			input_report_abs(input, ABS_PRESSURE, rt);
 
 			input_sync(input);
@@ -339,9 +338,9 @@ static int tsc2007_probe(struct i2c_client *client)
 	input_set_drvdata(input_dev, ts);
 
 	input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
-
 	input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, ts->fuzzx, 0);
 	input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, ts->fuzzy, 0);
+	touchscreen_parse_properties(input_dev, false, &ts->prop);
 	input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT,
 			     ts->fuzzz, 0);
 
Signature · 1 line
2.39.2
author maintainer
#2 lore raw

Re: [PATCH 1/2] Input: tsc2007 - accept standard properties

Am Mon, 14 Oct 2024 16:12:39 +0200
schrieb Andreas Kemnade <[email protected]>:

Quoted 5 lines

Only some driver-specific properties were accepted, change it to use the now-available standard properties which are found in devicetrees containing this chip.

ping

author maintainer
#3 lore raw

PATCH 2/2 ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties

In reply to Andreas Kemnade

Specify the dimensions of the touchscreen propertly so that no userspace configuration is needed for it. Tested with x11 and weston on Debian bookworm.

What is in now is some debris from earlier tries to handle scaling in kernel:

https://lore.kernel.org/linux-input/[email protected]/

---
 arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi +4 -2
index 3661340009e7a..6e25db29a4bb9 100644
@@ -591,8 +591,10 @@ tsc2007@48 {
 		interrupts = <0 IRQ_TYPE_EDGE_FALLING>; /* GPIO_160 */
 		gpios = <&gpio6 0 GPIO_ACTIVE_LOW>;	/* GPIO_160 */
 		ti,x-plate-ohms = <600>;
-		touchscreen-size-x = <480>;
-		touchscreen-size-y = <640>;
+		touchscreen-size-x = <0xf00>;
+		touchscreen-size-y = <0xf00>;
+		touchscreen-min-x = <0x100>;
+		touchscreen-min-y = <0x100>;
 		touchscreen-max-pressure = <1000>;
 		touchscreen-fuzz-x = <3>;
 		touchscreen-fuzz-y = <8>;
Signature · 1 line
2.39.2