From: Pavel Machek <pavel@ucw.cz>
To: Paul Parsons <lost.distance@yahoo.com>
Cc: rpurdie@rpsys.net, lenz@cs.wisc.edu,
kernel list <linux-kernel@vger.kernel.org>,
Dirk@Opfer-Online.de, arminlitzel@web.de,
Cyril Hrubis <metan@ucw.cz>,
thommycheck@gmail.com,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
dbaryshkov@gmail.com, omegamoon@gmail.com, eric.y.miao@gmail.com,
utx@penguin.cz
Subject: Re: [PATCH] hx4700: fix hx4700 touchscreen pressure values
Date: Tue, 17 Nov 2009 12:45:03 +0100 [thread overview]
Message-ID: <20091117114502.GA1376@ucw.cz> (raw)
In-Reply-To: <E1N9Lt7-0007mK-2t@relay07.plus.net>
Hi!
> hx4700 touchscreen events were being dropped in ads7846_rx() because their pressure values consistently exceeded the platform maximum of 512; a sample of 256 pressure values were in the range 531 to 815. Doubling the platform maximum to 1024 allows hx4700 touchscreen events to pass the test.
>
> Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Does pressure actually work as expected -- that is not inverted?
Because I need this patch on spitz... but it may break your
machine...
Binary files linux-rc/drivers/input.ofic/built-in.o and linux-rc/drivers/input/built-in.o differ
diff -ur linux-rc/drivers/input.ofic/touchscreen/ads7846.c linux-rc/drivers/input/touchscreen/ads7846.c
--- linux-rc/drivers/input.ofic/touchscreen/ads7846.c 2009-10-06 13:49:56.000000000 +0200
+++ linux-rc/drivers/input/touchscreen/ads7846.c 2009-10-06 21:18:25.000000000 +0200
@@ -29,10 +29,14 @@
#include <linux/spi/ads7846.h>
#include <asm/irq.h>
+#ifndef VERBOSE
+#undef dev_dbg
+#define dev_dbg(...) do {} while(0)
+#endif
/*
* This code has been heavily tested on a Nokia 770, and lightly
- * tested on other ads7846 devices (OSK/Mistral, Lubbock).
+ * tested on other ads7846 devices (OSK/Mistral, Lubbock, Spitz).
* TSC2046 is just newer ads7846 silicon.
* Support for ads7843 tested on Atmel at91sam926x-EK.
* Support for ads7845 has only been stubbed in.
@@ -43,7 +47,7 @@
* have to maintain our own SW IRQ disabled status. This should be
* removed as soon as the affected platform's IRQ handling is fixed.
*
- * app note sbaa036 talks in more detail about accurate sampling...
+ * App note sbaa036 talks in more detail about accurate sampling...
* that ought to help in situations like LCDs inducing noise (which
* can also be helped by using synch signals) and more generally.
* This driver tries to utilize the measures described in the app
@@ -566,10 +570,8 @@
* once more the measurement
*/
if (packet->tc.ignore || Rt > ts->pressure_max) {
-#ifdef VERBOSE
- pr_debug("%s: ignored %d pressure %d\n",
- dev_name(&ts->spi->dev), packet->tc.ignore, Rt);
-#endif
+ dev_dbg(&ts->spi->dev, "ignored %d pressure %d\n",
+ packet->tc.ignore, Rt);
hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
HRTIMER_MODE_REL);
return;
@@ -584,10 +586,11 @@
Rt = 0;
}
- /* NOTE: We can't rely on the pressure to determine the pen down
- * state, even this controller has a pressure sensor. The pressure
- * value can fluctuate for quite a while after lifting the pen and
- * in some cases may not even settle at the expected value.
+ /* NOTE: We can't rely on the pressure to determine the pen
+ * down state, not even if this controller has a pressure
+ * sensor. The pressure value can fluctuate for quite a while
+ * after lifting the pen and in some cases may not even settle
+ * at the expected value.
*
* The only safe way to check for the pen up condition is in the
* timer by reading the pen signal state (it's a GPIO _and_ IRQ).
@@ -598,9 +601,7 @@
if (!ts->pendown) {
input_report_key(input, BTN_TOUCH, 1);
ts->pendown = 1;
-#ifdef VERBOSE
dev_dbg(&ts->spi->dev, "DOWN\n");
-#endif
}
if (ts->swap_xy)
@@ -608,12 +609,10 @@
input_report_abs(input, ABS_X, x);
input_report_abs(input, ABS_Y, y);
- input_report_abs(input, ABS_PRESSURE, Rt);
+ input_report_abs(input, ABS_PRESSURE, ts->pressure_max-Rt);
input_sync(input);
-#ifdef VERBOSE
dev_dbg(&ts->spi->dev, "%4d/%4d/%4d\n", x, y, Rt);
-#endif
}
hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
@@ -723,9 +722,7 @@
input_sync(input);
ts->pendown = 0;
-#ifdef VERBOSE
dev_dbg(&ts->spi->dev, "UP\n");
-#endif
}
/* measurement cycle ended */
Binary files linux-rc/drivers/input.ofic/touchscreen/ads7846.o and linux-rc/drivers/input/touchscreen/ads7846.o differ
Binary files linux-rc/drivers/input.ofic/touchscreen/built-in.o and linux-rc/drivers/input/touchscreen/built-in.o differ
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next parent reply other threads:[~2009-11-17 11:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1N9Lt7-0007mK-2t@relay07.plus.net>
2009-11-17 11:45 ` Pavel Machek [this message]
2009-11-18 0:22 [PATCH] hx4700: fix hx4700 touchscreen pressure values Paul Parsons
2009-11-18 3:03 ` Eric Miao
2009-11-18 17:28 ` Pavel Machek
2009-11-18 17:39 ` Dmitry Torokhov
2009-11-18 17:46 ` Pavel Machek
2009-11-18 17:46 ` Dmitry Torokhov
2009-11-20 18:24 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091117114502.GA1376@ucw.cz \
--to=pavel@ucw.cz \
--cc=Dirk@Opfer-Online.de \
--cc=arminlitzel@web.de \
--cc=dbaryshkov@gmail.com \
--cc=eric.y.miao@gmail.com \
--cc=lenz@cs.wisc.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lost.distance@yahoo.com \
--cc=metan@ucw.cz \
--cc=omegamoon@gmail.com \
--cc=rpurdie@rpsys.net \
--cc=thommycheck@gmail.com \
--cc=utx@penguin.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox