2011-05-05 07:54:29

by microcai

[permalink] [raw]
Subject: [PATCH][INPUT]s3c2410_ts.c add report for ABS_PRESSURE, this fix tslib problem that not, been able to detect pen-down and pen-up events.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Heya,

I'm not sure if this works for every SoC, but works for my machine.
The tslib was never never able to detect pen-down and pen-up event even
the driver does report BT_TOUCH up and down, I figure out that what
it need is actually ABS_PRESSURE.

Spend days and night debug tslib, but amazing that it's the driver
that case the problem.

I've see the log,

- remove ABS_PRESSURE reporting, tslib can be fixed

It was removed once, so, I'm not sure if my patch fits for all, or
just my ugly hardware?


- From 995fbed3a4b0a913916b96eef907abe47fec3f91 Mon Sep 17 00:00:00 2001
From: microcai <[email protected]>
Date: Thu, 5 May 2011 14:40:44 +0800
Subject: [PATCH] add report for ABS_PRESSURE, this fix tslib problem
that not
been able to detect pen-down and pen-up events.

- ---
drivers/input/touchscreen/s3c2410_ts.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/s3c2410_ts.c
b/drivers/input/touchscreen/s3c2410_ts.c
index 8feb7f3..ecab5d4 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);
@@ -318,6 +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;
- --
1.7.5.rc3


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQEcBAEBAgAGBQJNwlesAAoJEKT4Uz7oTANZtY0IAJl4kK3fuApKja/k2gzaE5Py
7JP4oPxgmepbM8HK8JvQUhPLiWWKu1eZYkSAPJ1L95HeswYTIp4/iC8Ut+ieF4pq
+6tPd+ZcJlamTo9IZa1OwDCOOezgEUhP/aB7N9z+ARbVQaCqIBvEr9g2DVyPIXFb
B2xVfPZjnFwJAKuHZjpVn8ncN0LcpTgNU7W0o3z8YQw91Tjc9v+V58xE2xwzlpRi
wvovCpL3AAQ+uYXWLa5ChGU+xdAlJ7GyFQwzICleaSlxAgbF+USJlgkMO6pYlx7P
kdF2j3m01WYA82nKZH1kOpkX2vl1lZQMiOIVVoU8YC8huu5ty06Tr7UIEb5ar8I=
=NvuY
-----END PGP SIGNATURE-----