* ads7846 touchscreen: fix pressure
@ 2009-10-06 19:54 Pavel Machek
2009-10-08 5:09 ` Trilok Soni
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2009-10-06 19:54 UTC (permalink / raw)
To: dtor, dmitry.torokhov, linux-input; +Cc: kernel list, Andrew Morton
On Zaurus, pressure is reported inverted -- the lighter the pressure,
the bigger numerical value. This should fix it.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
--- 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
@@ -608,12 +609,12 @@
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),
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-10-06 19:54 Pavel Machek
@ 2009-10-08 5:09 ` Trilok Soni
2009-10-08 9:24 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Trilok Soni @ 2009-10-08 5:09 UTC (permalink / raw)
To: Pavel Machek
Cc: dtor, dmitry.torokhov, linux-input, kernel list, Andrew Morton
Hi Pavel,
On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <pavel@ucw.cz> wrote:
>
> On Zaurus, pressure is reported inverted -- the lighter the pressure,
> the bigger numerical value. This should fix it.
>
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
>
> --- 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
> @@ -608,12 +609,12 @@
>
> 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);
but same behavior is seen by others using this chip on different
boards? If not, this has to be done through platform data.
--
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-10-08 5:09 ` Trilok Soni
@ 2009-10-08 9:24 ` Pavel Machek
2009-10-09 16:35 ` Dmitry Torokhov
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2009-10-08 9:24 UTC (permalink / raw)
To: Trilok Soni
Cc: dtor, dmitry.torokhov, linux-input, kernel list, Andrew Morton
On Thu 2009-10-08 10:39:39, Trilok Soni wrote:
> Hi Pavel,
>
> On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <pavel@ucw.cz> wrote:
> >
> > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > the bigger numerical value. This should fix it.
> >
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> >
> > --- 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
> > @@ -608,12 +609,12 @@
> >
> > 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);
>
> but same behavior is seen by others using this chip on different
> boards? If not, this has to be done through platform data.
Well, I'd expect the chip to behave in similar way on all
platforms. Of course, it would be good if someone with different hw
tested it, but I do not have that hw...
So I guess the best way is to make it go in early and see how it does
in testing....
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-10-08 9:24 ` Pavel Machek
@ 2009-10-09 16:35 ` Dmitry Torokhov
2009-10-09 20:22 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2009-10-09 16:35 UTC (permalink / raw)
To: Pavel Machek; +Cc: Trilok Soni, linux-input, kernel list, Andrew Morton
On Thu, Oct 08, 2009 at 11:24:33AM +0200, Pavel Machek wrote:
> On Thu 2009-10-08 10:39:39, Trilok Soni wrote:
> > Hi Pavel,
> >
> > On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <pavel@ucw.cz> wrote:
> > >
> > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > the bigger numerical value. This should fix it.
> > >
> > > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > >
> > > --- 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
> > > @@ -608,12 +609,12 @@
> > >
> > > 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);
> >
> > but same behavior is seen by others using this chip on different
> > boards? If not, this has to be done through platform data.
>
> Well, I'd expect the chip to behave in similar way on all
> platforms. Of course, it would be good if someone with different hw
> tested it, but I do not have that hw...
>
> So I guess the best way is to make it go in early and see how it does
> in testing....
No, this is not how it works. Please do
git log -- drivers/input/touchscreen/ads7846.c
and try to check with people who were working on this driver. I somehow
doubt that they'd overlook such obvious issue as inverted pressure
readings.
--
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-10-09 16:35 ` Dmitry Torokhov
@ 2009-10-09 20:22 ` Pavel Machek
2009-10-13 13:29 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2009-10-09 20:22 UTC (permalink / raw)
To: Dmitry Torokhov, mroth, bn, eric.miao
Cc: Trilok Soni, linux-input, kernel list, Andrew Morton
On Fri 2009-10-09 09:35:07, Dmitry Torokhov wrote:
> On Thu, Oct 08, 2009 at 11:24:33AM +0200, Pavel Machek wrote:
> > On Thu 2009-10-08 10:39:39, Trilok Soni wrote:
> > > Hi Pavel,
> > >
> > > On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <pavel@ucw.cz> wrote:
> > > >
> > > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > > the bigger numerical value. This should fix it.
> > > >
> > > > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > > >
> > > > --- 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
> > > > @@ -608,12 +609,12 @@
> > > >
> > > > 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);
> > >
> > > but same behavior is seen by others using this chip on different
> > > boards? If not, this has to be done through platform data.
> >
> > Well, I'd expect the chip to behave in similar way on all
> > platforms. Of course, it would be good if someone with different hw
> > tested it, but I do not have that hw...
> >
> > So I guess the best way is to make it go in early and see how it does
> > in testing....
>
> No, this is not how it works. Please do
>
> git log -- drivers/input/touchscreen/ads7846.c
>
> and try to check with people who were working on this driver. I somehow
> doubt that they'd overlook such obvious issue as inverted pressure
> readings.
Well, it was certainly not obvious to the one who switched zaurus to
ads7846, thus causing regression.
Anyway, people, can you please test ads7846, to see if it has normal
or inverted pressure readings? I could only find 3 people contributing
to ads7846 in last year or so, and Eric was one of them...
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] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-10-09 20:22 ` Pavel Machek
@ 2009-10-13 13:29 ` Pavel Machek
0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2009-10-13 13:29 UTC (permalink / raw)
To: Dmitry Torokhov, mroth, bn, eric.miao
Cc: Trilok Soni, linux-input, kernel list, Andrew Morton
On Fri 2009-10-09 22:22:51, Pavel Machek wrote:
> On Fri 2009-10-09 09:35:07, Dmitry Torokhov wrote:
> > On Thu, Oct 08, 2009 at 11:24:33AM +0200, Pavel Machek wrote:
> > > On Thu 2009-10-08 10:39:39, Trilok Soni wrote:
> > > > Hi Pavel,
> > > >
> > > > On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <pavel@ucw.cz> wrote:
> > > > >
> > > > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > > > the bigger numerical value. This should fix it.
> > > > >
> > > > > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > > > >
> > > > > --- 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
> > > > > @@ -608,12 +609,12 @@
> > > > >
> > > > > ? ? ? ? ? ? ? ?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);
> > > >
> > > > but same behavior is seen by others using this chip on different
> > > > boards? If not, this has to be done through platform data.
> > >
> > > Well, I'd expect the chip to behave in similar way on all
> > > platforms. Of course, it would be good if someone with different hw
> > > tested it, but I do not have that hw...
> > >
> > > So I guess the best way is to make it go in early and see how it does
> > > in testing....
> >
> > No, this is not how it works. Please do
> >
> > git log -- drivers/input/touchscreen/ads7846.c
> >
> > and try to check with people who were working on this driver. I somehow
> > doubt that they'd overlook such obvious issue as inverted pressure
> > readings.
>
> Well, it was certainly not obvious to the one who switched zaurus to
> ads7846, thus causing regression.
>
> Anyway, people, can you please test ads7846, to see if it has normal
> or inverted pressure readings? I could only find 3 people contributing
> to ads7846 in last year or so, and Eric was one of them...
So... what is the plan here? Can we just make the fix go in? ...it
seems noone will test it otherwise.
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] 10+ messages in thread
* ads7846 touchscreen: fix pressure
@ 2009-11-20 18:22 Pavel Machek
2009-11-20 18:25 ` Dmitry Torokhov
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2009-11-20 18:22 UTC (permalink / raw)
To: dtor, dmitry.torokhov, linux-input; +Cc: kernel list, Andrew Morton
On Zaurus, pressure is reported inverted -- the lighter the pressure,
the bigger numerical value. This should fix it.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
--- 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
@@ -608,12 +609,12 @@
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),
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-11-20 18:22 ads7846 touchscreen: fix pressure Pavel Machek
@ 2009-11-20 18:25 ` Dmitry Torokhov
2009-11-20 18:50 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2009-11-20 18:25 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-input, kernel list, Andrew Morton
On Fri, Nov 20, 2009 at 07:22:39PM +0100, Pavel Machek wrote:
>
> On Zaurus, pressure is reported inverted -- the lighter the pressure,
> the bigger numerical value. This should fix it.
>
Thanks. Didn't you also have a bigger cleanup patch for ads7846?
--
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-11-20 18:25 ` Dmitry Torokhov
@ 2009-11-20 18:50 ` Pavel Machek
2009-11-26 2:10 ` Dmitry Torokhov
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2009-11-20 18:50 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, kernel list, Andrew Morton
Hi!
> > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > the bigger numerical value. This should fix it.
> >
>
> Thanks. Didn't you also have a bigger cleanup patch for ads7846?
Yes, I did, but I wanted to avoid risk for collision. So pick one...
--
Cleanup touchscreen driver and fix pressure on spitz.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
--- linux-rc/drivers/input/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 */
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ads7846 touchscreen: fix pressure
2009-11-20 18:50 ` Pavel Machek
@ 2009-11-26 2:10 ` Dmitry Torokhov
0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2009-11-26 2:10 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-input, kernel list, Andrew Morton
On Fri, Nov 20, 2009 at 07:50:58PM +0100, Pavel Machek wrote:
> Hi!
>
> > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > the bigger numerical value. This should fix it.
> > >
> >
> > Thanks. Didn't you also have a bigger cleanup patch for ads7846?
>
> Yes, I did, but I wanted to avoid risk for collision. So pick one...
>
Thanks. I ended up picking both...
--
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-11-26 2:10 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 18:22 ads7846 touchscreen: fix pressure Pavel Machek
2009-11-20 18:25 ` Dmitry Torokhov
2009-11-20 18:50 ` Pavel Machek
2009-11-26 2:10 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2009-10-06 19:54 Pavel Machek
2009-10-08 5:09 ` Trilok Soni
2009-10-08 9:24 ` Pavel Machek
2009-10-09 16:35 ` Dmitry Torokhov
2009-10-09 20:22 ` Pavel Machek
2009-10-13 13:29 ` 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).