* [PATCH] hx4700: fix hx4700 touchscreen pressure values
@ 2009-11-14 16:54 Paul Parsons
2009-11-16 16:37 ` Eric Miao
2009-11-17 11:45 ` Pavel Machek
0 siblings, 2 replies; 9+ messages in thread
From: Paul Parsons @ 2009-11-14 16:54 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
--- linux-2.6.32-rc7/arch/arm/mach-pxa/hx4700.c.orig 2009-11-14 15:19:59.294682971 +0000
+++ linux-2.6.32-rc7/arch/arm/mach-pxa/hx4700.c 2009-11-14 15:20:14.677951232 +0000
@@ -604,7 +604,7 @@ static struct platform_device gpio_vbus
static const struct ads7846_platform_data tsc2046_info = {
.model = 7846,
.vref_delay_usecs = 100,
- .pressure_max = 512,
+ .pressure_max = 1024,
.debounce_max = 10,
.debounce_tol = 3,
.debounce_rep = 1,
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
2009-11-14 16:54 Paul Parsons
@ 2009-11-16 16:37 ` Eric Miao
2009-11-17 11:45 ` Pavel Machek
1 sibling, 0 replies; 9+ messages in thread
From: Eric Miao @ 2009-11-16 16:37 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Nov 15, 2009 at 12:54 AM, Paul Parsons <lost.distance@yahoo.com> wrote:
> 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>
Applied to 'fix', thanks.
> ---
> --- linux-2.6.32-rc7/arch/arm/mach-pxa/hx4700.c.orig ? ?2009-11-14 15:19:59.294682971 +0000
> +++ linux-2.6.32-rc7/arch/arm/mach-pxa/hx4700.c 2009-11-14 15:20:14.677951232 +0000
> @@ -604,7 +604,7 @@ static struct platform_device gpio_vbus
> ?static const struct ads7846_platform_data tsc2046_info = {
> ? ? ? ?.model ? ? ? ? ? ?= 7846,
> ? ? ? ?.vref_delay_usecs = 100,
> - ? ? ? .pressure_max ? ? = 512,
> + ? ? ? .pressure_max ? ? = 1024,
> ? ? ? ?.debounce_max ? ? = 10,
> ? ? ? ?.debounce_tol ? ? = 3,
> ? ? ? ?.debounce_rep ? ? = 1,
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
2009-11-14 16:54 Paul Parsons
2009-11-16 16:37 ` Eric Miao
@ 2009-11-17 11:45 ` Pavel Machek
1 sibling, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2009-11-17 11:45 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
@ 2009-11-18 0:22 Paul Parsons
2009-11-18 3:03 ` Eric Miao
2009-11-18 17:28 ` Pavel Machek
0 siblings, 2 replies; 9+ messages in thread
From: Paul Parsons @ 2009-11-18 0:22 UTC (permalink / raw)
To: linux-arm-kernel
> Does pressure actually work as expected -- that is not inverted?
> Because I need this patch on spitz... but it may break your
> machine...
You are right, the pressure values were being inverted on my hx4700.
Pressing hard generates somewhat lower Rt values than pressing lightly.
Since typical hx4700 Rt values are close to (pressure_max/2) anyway,
the inverted and non-inverted values were not very different.
For example:
Rt ts->pressure_max-Rt
599 425
562 462
588 436
570 454
So by all means submit your ads7846.c patch; it will not break hx4700.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
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
1 sibling, 0 replies; 9+ messages in thread
From: Eric Miao @ 2009-11-18 3:03 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 18, 2009 at 8:22 AM, Paul Parsons <lost.distance@yahoo.com> wrote:
>> Does pressure actually work as expected -- that is not inverted?
>> Because I need this patch on spitz... ?but it may break your
>> machine...
>
> You are right, the pressure values were being inverted on my hx4700.
> Pressing hard generates somewhat lower Rt values than pressing lightly.
>
> Since typical hx4700 Rt values are close to (pressure_max/2) anyway,
> the inverted and non-inverted values were not very different.
> For example:
>
> Rt ? ? ?ts->pressure_max-Rt
> 599 ? ? 425
> 562 ? ? 462
> 588 ? ? 436
> 570 ? ? 454
>
> So by all means submit your ads7846.c patch; it will not break hx4700.
>
Is this generically true that the pressure is always inverted? Otherwise
a platform specific field indicating this would be the better way to go.
- eric
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
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
1 sibling, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2009-11-18 17:28 UTC (permalink / raw)
To: linux-arm-kernel
On Wed 2009-11-18 00:22:41, Paul Parsons wrote:
> > Does pressure actually work as expected -- that is not inverted?
> > Because I need this patch on spitz... but it may break your
> > machine...
>
> You are right, the pressure values were being inverted on my hx4700.
> Pressing hard generates somewhat lower Rt values than pressing lightly.
>
> Since typical hx4700 Rt values are close to (pressure_max/2) anyway,
> the inverted and non-inverted values were not very different.
> For example:
>
> Rt ts->pressure_max-Rt
> 599 425
> 562 462
> 588 436
> 570 454
>
> So by all means submit your ads7846.c patch; it will not break hx4700.
Dmitry, those pressure values are reverted on more than one machine,
and we do not have anyone reporting it works ok for them. Can we
perhaps just.... fix it?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
2009-11-18 17:28 ` Pavel Machek
@ 2009-11-18 17:39 ` Dmitry Torokhov
2009-11-18 17:46 ` Dmitry Torokhov
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Torokhov @ 2009-11-18 17:39 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 18, 2009 at 06:28:49PM +0100, Pavel Machek wrote:
> On Wed 2009-11-18 00:22:41, Paul Parsons wrote:
> > > Does pressure actually work as expected -- that is not inverted?
> > > Because I need this patch on spitz... but it may break your
> > > machine...
> >
> > You are right, the pressure values were being inverted on my hx4700.
> > Pressing hard generates somewhat lower Rt values than pressing lightly.
> >
> > Since typical hx4700 Rt values are close to (pressure_max/2) anyway,
> > the inverted and non-inverted values were not very different.
> > For example:
> >
> > Rt ts->pressure_max-Rt
> > 599 425
> > 562 462
> > 588 436
> > 570 454
> >
> > So by all means submit your ads7846.c patch; it will not break hx4700.
>
> Dmitry, those pressure values are reverted on more than one machine,
> and we do not have anyone reporting it works ok for them. Can we
> perhaps just.... fix it?
OK, so we have 4 instances where pressure is inverted and nobody wants
to come out with a non-inverted example... I'll queue for .33 then - .32
it too close to the release.
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
2009-11-18 17:39 ` Dmitry Torokhov
@ 2009-11-18 17:46 ` Dmitry Torokhov
2009-11-20 18:24 ` Pavel Machek
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Torokhov @ 2009-11-18 17:46 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 18, 2009 at 09:39:34AM -0800, Dmitry Torokhov wrote:
> On Wed, Nov 18, 2009 at 06:28:49PM +0100, Pavel Machek wrote:
> > On Wed 2009-11-18 00:22:41, Paul Parsons wrote:
> > > > Does pressure actually work as expected -- that is not inverted?
> > > > Because I need this patch on spitz... but it may break your
> > > > machine...
> > >
> > > You are right, the pressure values were being inverted on my hx4700.
> > > Pressing hard generates somewhat lower Rt values than pressing lightly.
> > >
> > > Since typical hx4700 Rt values are close to (pressure_max/2) anyway,
> > > the inverted and non-inverted values were not very different.
> > > For example:
> > >
> > > Rt ts->pressure_max-Rt
> > > 599 425
> > > 562 462
> > > 588 436
> > > 570 454
> > >
> > > So by all means submit your ads7846.c patch; it will not break hx4700.
> >
> > Dmitry, those pressure values are reverted on more than one machine,
> > and we do not have anyone reporting it works ok for them. Can we
> > perhaps just.... fix it?
>
> OK, so we have 4 instances where pressure is inverted and nobody wants
> to come out with a non-inverted example... I'll queue for .33 then - .32
> it too close to the release.
>
Btw, could you send me the latest version of your patch please?
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] hx4700: fix hx4700 touchscreen pressure values
2009-11-18 17:46 ` Dmitry Torokhov
@ 2009-11-20 18:24 ` Pavel Machek
0 siblings, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2009-11-20 18:24 UTC (permalink / raw)
To: linux-arm-kernel
> > > Dmitry, those pressure values are reverted on more than one machine,
> > > and we do not have anyone reporting it works ok for them. Can we
> > > perhaps just.... fix it?
> >
> > OK, so we have 4 instances where pressure is inverted and nobody wants
> > to come out with a non-inverted example... I'll queue for .33 then - .32
> > it too close to the release.
> >
>
> Btw, could you send me the latest version of your patch please?
Yep, resent in separate mail.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-11-20 18:24 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` Dmitry Torokhov
2009-11-20 18:24 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2009-11-14 16:54 Paul Parsons
2009-11-16 16:37 ` Eric Miao
2009-11-17 11:45 ` Pavel Machek
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).