Skip to contentSkip to conversation

INPUT:Add ABS_PRESSURE input event support for touchscreen driver

PATCH In review Wu DaoGuang 4 participants 6 messages Jun 24, 2011 – Jun 27, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 INPUT:Add ABS_PRESSURE input event support for touchscreen driver

The touchscreen driver s3c2410_ts.c doesn't work well when using the tslib, an abstraction layer for touchscreen panel events. Tslib needs ABS_X ABS_Y and ABS_PRESSURE events to report, but only the former two the driver can provide.

So this patch fixes the problem.

---
 drivers/input/touchscreen/s3c2410_ts.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/input/touchscreen/s3c2410_ts.c +3 -1
index 8feb7f3..0cf4f12 100644
@@ -126,6 +126,7 @@ static void touch_timer_fire(unsigned long data)
 			input_report_abs(ts.input, ABS_Y, ts.yp);
 
 			input_report_key(ts.input, BTN_TOUCH, 1);
+			input_report_abs(ts.input, ABS_PRESSURE, 1);
 			input_sync(ts.input);
 
 			ts.xp = 0;
@@ -140,6 +141,7 @@ static void touch_timer_fire(unsigned long data)
 		ts.count = 0;
 
 		input_report_key(ts.input, BTN_TOUCH, 0);
+		input_report_abs(ts.input, ABS_PRESSURE, 0);
 		input_sync(ts.input);
 
 		writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC);
@@ -318,7 +320,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
 	ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 	input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0);
 	input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0);
-
+	input_set_abs_params(ts.input, ABS_PRESSURE, 0, 1, 0, 0);
 	ts.input->name = "S3C24XX TouchScreen";
 	ts.input->id.bustype = BUS_HOST;
 	ts.input->id.vendor = 0xDEAD;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 33 lines · Wu DaoGuang

The touchscreen driver s3c2410_ts.c doesn't work well when using the tslib, an abstraction layer for touchscreen panel events. Tslib needs ABS_X ABS_Y and ABS_PRESSURE events to report, but only the former two the driver can provide.

So this patch fixes the problem.

---
  drivers/input/touchscreen/s3c2410_ts.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
drivers/input/touchscreen/s3c2410_ts.c +2 -0
index 8feb7f3..0cf4f12 100644
@@ -126,6 +126,7 @@ static void touch_timer_fire(unsigned long data)
  			input_report_abs(ts.input, ABS_Y, ts.yp);
 
  			input_report_key(ts.input, BTN_TOUCH, 1);
+			input_report_abs(ts.input, ABS_PRESSURE, 1);
  			input_sync(ts.input);
 
  			ts.xp = 0;
@@ -140,6 +141,7 @@ static void touch_timer_fire(unsigned long data)
  		ts.count = 0;
 
  		input_report_key(ts.input, BTN_TOUCH, 0);
+		input_report_abs(ts.input, ABS_PRESSURE, 0);
  		input_sync(ts.input);
 
  		writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC);

drivers/input/touchscreen/s3c2410_ts.c static int __devinit s3c2410ts_probe(struct platform_device *pdev) · line 326

Quoted 8 lines
drivers/input/touchscreen/s3c2410_ts.c +1 -1
@@ -318,7 +320,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
  	ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
  	input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0);
  	input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0);
-
+	input_set_abs_params(ts.input, ABS_PRESSURE, 0, 1, 0, 0);
  	ts.input->name = "S3C24XX TouchScreen";
  	ts.input->id.bustype = BUS_HOST;
  	ts.input->id.vendor = 0xDEAD;

This is already NAKed patch.

Please refer https://lkml.org/lkml/2010/11/9/270

Thanks.

#2 lore raw
In reply to Wu DaoGuang
Quoted 4 lines · Wu DaoGuang

The touchscreen driver s3c2410_ts.c doesn't work well when using the tslib, an abstraction layer for touchscreen panel events. Tslib needs ABS_X ABS_Y and ABS_PRESSURE events to report, but only the former two the driver can provide.

It seems much more sane to fix this in tslib, the kernel is not actually reporting pressure meaningfully here and there's already BTN_TOUCH to report if the pen is down.

#3 lore raw

2011/6/24 Mark Brown <[email protected]>:

Quoted 10 lines · Wu DaoGuang
Quoted 4 lines

The touchscreen driver s3c2410_ts.c doesn't work well when using the tslib, an abstraction layer for touchscreen panel events. Tslib needs ABS_X ABS_Y and ABS_PRESSURE events to report, but only the former two the driver can provide.

It seems much more sane to fix this in tslib, the kernel is not actually reporting pressure meaningfully here and there's already BTN_TOUCH to report if the pen is down.

yeah,I will try to fix it in tslib.
Thanks a lot.

#4 lore raw
Quoted 22 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-arm-kernel-bounces at lists.infradead.org] On Behalf Of daoguang wu
Sent: 2011?6?27? 10:15
To: Mark Brown
Cc: kgene.kim at samsung.com; ben-linux at fluff.org; dmitry.torokhov at gmail.com; linux-kernel at vger.kernel.org; wdgvip at gamil.com; linux-input at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] INPUT:Add ABS_PRESSURE input event support for touchscreen driver

2011/6/24 Mark Brown <[email protected]>:

Quoted 6 lines · Wu DaoGuang
Quoted 4 lines

The touchscreen driver s3c2410_ts.c doesn't work well when using the tslib, an abstraction layer for touchscreen panel events. Tslib needs ABS_X ABS_Y and ABS_PRESSURE events to report, but only the former two the driver can provide.

Quoted 5 lines
Quoted 4 lines

It seems much more sane to fix this in tslib, the kernel is not actually reporting pressure meaningfully here and there's already BTN_TOUCH to report if the pen is down.

yeah,I will try to fix it in tslib.

You may send a patch to tslib.

Quoted 11 lines

Thanks a lot.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

To report this email as spam click
https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==
t4zoc+!n!INSV2C4qhUHSr1YUlPAL0C6yBmfTIRMbBnxawg== .

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

#6 lore raw
In reply to a message not in the archive

2011/6/27 Dmitry Torokhov <[email protected]>:

Quoted 36 lines
Quoted 32 lines · Baohua Song
Quoted 5 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-arm-kernel-bounces at lists.infradead.org] On Behalf Of

daoguang

Quoted 10 lines

wu
Sent: 2011?6?27? 10:15
To: Mark Brown
Cc: kgene.kim at samsung.com; ben-linux at fluff.org; dmitry.torokhov at gmail.com; linux-kernel at vger.kernel.org; wdgvip at gamil.com; linux-input at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] INPUT:Add ABS_PRESSURE input event support for touchscreen driver

Quoted 5 lines

2011/6/24 Mark Brown <[email protected]>:

Quoted 4 lines · Wu DaoGuang
Quoted 3 lines

The touchscreen driver s3c2410_ts.c doesn't work well when using the tslib, an abstraction layer for touchscreen panel events. Tslib needs ABS_X ABS_Y and ABS_PRESSURE events to report, but

only

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

the former two the driver can provide.

It seems much more sane to fix this in tslib, the kernel is not

actually

Quoted 1 line
Quoted 1 line

reporting pressure meaningfully here and there's already BTN_TOUCH

to

Quoted 3 lines
Quoted 2 lines

report if the pen is down.

yeah,I will try to fix it in tslib.

Quoted 7 lines
Quoted 2 lines

You may send a patch to tslib.

This has already been fixed in tslib a couple years ago. I'm not sure if a new version was cut or not.
--
Dmitry

I try the latest tslib ,and find there is no such problem and the latest version of tslib can be downloaded from
git://github.com/kergoth/tslib.git.

Thanks a lot.