2009-10-07 21:08:30

by Pavel Machek

[permalink] [raw]
Subject: ads7846 touchscreen: fix pressure


On Zaurus, pressure is reported inverted -- the lighter the pressure,
the bigger numerical value. This should fix it.

Signed-off-by: Pavel Machek <[email protected]>

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


2009-10-08 05:10:19

by Trilok Soni

[permalink] [raw]
Subject: Re: ads7846 touchscreen: fix pressure

Hi Pavel,

On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <[email protected]> wrote:
>
> On Zaurus, pressure is reported inverted -- the lighter the pressure,
> the bigger numerical value. This should fix it.
>
> Signed-off-by: Pavel Machek <[email protected]>
>
> --- 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

2009-10-08 09:25:21

by Pavel Machek

[permalink] [raw]
Subject: Re: ads7846 touchscreen: fix pressure

On Thu 2009-10-08 10:39:39, Trilok Soni wrote:
> Hi Pavel,
>
> On Wed, Oct 7, 2009 at 1:24 AM, Pavel Machek <[email protected]> wrote:
> >
> > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > the bigger numerical value. This should fix it.
> >
> > Signed-off-by: Pavel Machek <[email protected]>
> >
> > --- 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

2009-10-09 16:35:58

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: ads7846 touchscreen: fix pressure

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 <[email protected]> wrote:
> > >
> > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > the bigger numerical value. This should fix it.
> > >
> > > Signed-off-by: Pavel Machek <[email protected]>
> > >
> > > --- 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

2009-10-09 20:23:36

by Pavel Machek

[permalink] [raw]
Subject: Re: ads7846 touchscreen: fix pressure

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 <[email protected]> wrote:
> > > >
> > > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > > the bigger numerical value. This should fix it.
> > > >
> > > > Signed-off-by: Pavel Machek <[email protected]>
> > > >
> > > > --- 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

2009-10-13 13:30:04

by Pavel Machek

[permalink] [raw]
Subject: Re: ads7846 touchscreen: fix pressure

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 <[email protected]> wrote:
> > > > >
> > > > > On Zaurus, pressure is reported inverted -- the lighter the pressure,
> > > > > the bigger numerical value. This should fix it.
> > > > >
> > > > > Signed-off-by: Pavel Machek <[email protected]>
> > > > >
> > > > > --- 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