linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties
@ 2024-12-05 20:44 akemnade
  2024-12-05 20:44 ` [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties akemnade
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: akemnade @ 2024-12-05 20:44 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andreas Kemnade, Tony Lindgren,
	Conor Dooley, linux-omap, khilman, Dmitry Torokhov, devicetree,
	linux-input, linux-kernel
  Cc: Andreas Kemnade

From: Andreas Kemnade <akemnade@kernel.org>

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(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties
  2024-12-05 20:44 [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties akemnade
@ 2024-12-05 20:44 ` akemnade
  2024-12-09 17:52   ` Dmitry Torokhov
  2024-12-05 20:44 ` [PATCH RESEND 2/2] ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties akemnade
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: akemnade @ 2024-12-05 20:44 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andreas Kemnade, Tony Lindgren,
	Conor Dooley, linux-omap, khilman, Dmitry Torokhov, devicetree,
	linux-input, linux-kernel

From: Andreas Kemnade <andreas@kemnade.info>

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

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 drivers/input/touchscreen/tsc2007.h      | 2 ++
 drivers/input/touchscreen/tsc2007_core.c | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2007.h b/drivers/input/touchscreen/tsc2007.h
index 69b08dd6c8df1..e346fb4f75521 100644
--- a/drivers/input/touchscreen/tsc2007.h
+++ b/drivers/input/touchscreen/tsc2007.h
@@ -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;
diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
index 8d832a372b897..5252301686ec6 100644
--- a/drivers/input/touchscreen/tsc2007_core.c
+++ b/drivers/input/touchscreen/tsc2007_core.c
@@ -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);
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH RESEND 2/2] ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties
  2024-12-05 20:44 [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties akemnade
  2024-12-05 20:44 ` [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties akemnade
@ 2024-12-05 20:44 ` akemnade
  2024-12-05 23:05 ` [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 " Kevin Hilman
  2024-12-11  0:20 ` Kevin Hilman
  3 siblings, 0 replies; 8+ messages in thread
From: akemnade @ 2024-12-05 20:44 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andreas Kemnade, Tony Lindgren,
	Conor Dooley, linux-omap, khilman, Dmitry Torokhov, devicetree,
	linux-input, linux-kernel

From: Andreas Kemnade <andreas@kemnade.info>

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/cover.1482936802.git.hns@goldelico.com/

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi b/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi
index 2ee3ddd640209..ed728661e1895 100644
--- a/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi
+++ b/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi
@@ -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>;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties
  2024-12-05 20:44 [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties akemnade
  2024-12-05 20:44 ` [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties akemnade
  2024-12-05 20:44 ` [PATCH RESEND 2/2] ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties akemnade
@ 2024-12-05 23:05 ` Kevin Hilman
  2024-12-09 17:52   ` Dmitry Torokhov
  2024-12-11  0:20 ` Kevin Hilman
  3 siblings, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2024-12-05 23:05 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Kemnade, Rob Herring, Krzysztof Kozlowski,
	Andreas Kemnade, Tony Lindgren, Conor Dooley, linux-omap,
	devicetree, linux-input, linux-kernel

Dmitry,

akemnade@kernel.org writes:

> From: Andreas Kemnade <akemnade@kernel.org>
>
> 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.

Due to this dependency, I can queue this driver patch in my tree along
with the DT patch so things go in together.  Let me know your
preference.

Kevin


> 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(-)
>
> -- 
> 2.39.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties
  2024-12-05 20:44 ` [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties akemnade
@ 2024-12-09 17:52   ` Dmitry Torokhov
  2025-03-16 22:44     ` Andreas Kemnade
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2024-12-09 17:52 UTC (permalink / raw)
  To: akemnade
  Cc: Rob Herring, Krzysztof Kozlowski, Andreas Kemnade, Tony Lindgren,
	Conor Dooley, linux-omap, khilman, devicetree, linux-input,
	linux-kernel

On Thu, Dec 05, 2024 at 09:44:12PM +0100, akemnade@kernel.org wrote:
> From: Andreas Kemnade <andreas@kemnade.info>
> 
> Only some driver-specific properties were accepted, change it
> to use the now-available standard properties which are
> found in devicetrees containing this chip.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/input/touchscreen/tsc2007.h      | 2 ++
>  drivers/input/touchscreen/tsc2007_core.c | 5 ++---
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/tsc2007.h b/drivers/input/touchscreen/tsc2007.h
> index 69b08dd6c8df1..e346fb4f75521 100644
> --- a/drivers/input/touchscreen/tsc2007.h
> +++ b/drivers/input/touchscreen/tsc2007.h
> @@ -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;
> diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
> index 8d832a372b897..5252301686ec6 100644
> --- a/drivers/input/touchscreen/tsc2007_core.c
> +++ b/drivers/input/touchscreen/tsc2007_core.c
> @@ -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);
>  
> -- 
> 2.39.2
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties
  2024-12-05 23:05 ` [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 " Kevin Hilman
@ 2024-12-09 17:52   ` Dmitry Torokhov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2024-12-09 17:52 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Andreas Kemnade, Rob Herring, Krzysztof Kozlowski,
	Andreas Kemnade, Tony Lindgren, Conor Dooley, linux-omap,
	devicetree, linux-input, linux-kernel

On Thu, Dec 05, 2024 at 03:05:57PM -0800, Kevin Hilman wrote:
> Dmitry,
> 
> akemnade@kernel.org writes:
> 
> > From: Andreas Kemnade <akemnade@kernel.org>
> >
> > 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.
> 
> Due to this dependency, I can queue this driver patch in my tree along
> with the DT patch so things go in together.  Let me know your
> preference.

Sure, works for me.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties
  2024-12-05 20:44 [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties akemnade
                   ` (2 preceding siblings ...)
  2024-12-05 23:05 ` [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 " Kevin Hilman
@ 2024-12-11  0:20 ` Kevin Hilman
  3 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2024-12-11  0:20 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andreas Kemnade, Tony Lindgren,
	Conor Dooley, linux-omap, Dmitry Torokhov, devicetree,
	linux-input, linux-kernel, akemnade


On Thu, 05 Dec 2024 21:44:11 +0100, akemnade@kernel.org wrote:
> From: Andreas Kemnade <akemnade@kernel.org>
> 
> 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.
> 
> [...]

Applied, thanks!

[1/2] Input: tsc2007 - accept standard properties
      commit: 6ef4ea3c944b9fc5d78317d1172cdcd10f9724f1
[2/2] ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties
      commit: 77f40f1983c40f6dba0a5eef125a037498de8268

Best regards,
-- 
Kevin Hilman <khilman@baylibre.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties
  2024-12-09 17:52   ` Dmitry Torokhov
@ 2025-03-16 22:44     ` Andreas Kemnade
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Kemnade @ 2025-03-16 22:44 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: akemnade, Rob Herring, Krzysztof Kozlowski, Tony Lindgren,
	Conor Dooley, linux-omap, khilman, devicetree, linux-input,
	linux-kernel

Am Mon, 9 Dec 2024 09:52:11 -0800
schrieb Dmitry Torokhov <dmitry.torokhov@gmail.com>:

> On Thu, Dec 05, 2024 at 09:44:12PM +0100, akemnade@kernel.org wrote:
> > From: Andreas Kemnade <andreas@kemnade.info>
> > 
> > Only some driver-specific properties were accepted, change it
> > to use the now-available standard properties which are
> > found in devicetrees containing this chip.
> > 
> > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>  
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

this was in -next but somehow flipped through, so maybe apply it
directly to input now?

Regards,
Andreas

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-03-16 22:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-05 20:44 [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 touchscreen properties akemnade
2024-12-05 20:44 ` [PATCH RESEND 1/2] Input: tsc2007 - accept standard properties akemnade
2024-12-09 17:52   ` Dmitry Torokhov
2025-03-16 22:44     ` Andreas Kemnade
2024-12-05 20:44 ` [PATCH RESEND 2/2] ARM: dts: ti/omap: omap3-gta04: use proper touchscreen properties akemnade
2024-12-05 23:05 ` [PATCH RESEND 0/2] ARM: ti/omap: gta04: properly specify GTA04 " Kevin Hilman
2024-12-09 17:52   ` Dmitry Torokhov
2024-12-11  0:20 ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).