linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: touchscreen: s3c2410: Add ABS_PRESSURE event sending.
@ 2010-11-09 13:00 Marek Belisko
  2010-11-09 15:54 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Belisko @ 2010-11-09 13:00 UTC (permalink / raw)
  To: Vincent Sanders; +Cc: Marek Belisko, Dmitry Torokhov, linux-input, linux-kernel

This patch add sending of event ABS_PRESSURE for
s3c24xx touchscreen.

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
---
 drivers/input/touchscreen/s3c2410_ts.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 8feb7f3..a937105 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -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);
@@ -314,10 +316,12 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
 	}
 
 	ts.input = input_dev;
-	ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+	ts.input->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) |
+				BIT_MASK(EV_ABS);
 	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;
-- 
1.7.1


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

* Re: [PATCH] input: touchscreen: s3c2410: Add ABS_PRESSURE event sending.
  2010-11-09 13:00 [PATCH] input: touchscreen: s3c2410: Add ABS_PRESSURE event sending Marek Belisko
@ 2010-11-09 15:54 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2010-11-09 15:54 UTC (permalink / raw)
  To: Marek Belisko; +Cc: Vincent Sanders, linux-input, linux-kernel

On Tue, Nov 09, 2010 at 02:00:16PM +0100, Marek Belisko wrote:
> This patch add sending of event ABS_PRESSURE for
> s3c24xx touchscreen.
> 
> Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
> ---
>  drivers/input/touchscreen/s3c2410_ts.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index 8feb7f3..a937105 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -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);

No, if device does not provide true pressure readings it should not send
ABS_PRESSURE events. Please fix your userspace.

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2010-11-09 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 13:00 [PATCH] input: touchscreen: s3c2410: Add ABS_PRESSURE event sending Marek Belisko
2010-11-09 15:54 ` Dmitry Torokhov

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