From: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "H. Nikolaus Schaller" <hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
Cc: "Rob Herring" <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Dmitry Torokhov"
<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"Benoît Cousson"
<bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
"Tony Lindgren" <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
"Russell King" <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
"Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
"Michael Welling" <mwelling-EkmVulN54Sk@public.gmane.org>,
"Mika Penttilä"
<mika.penttila-MRsr7dthA9VWk0Htik3J/w@public.gmane.org>,
"Javier Martinez Canillas"
<javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>,
"Igor Grinberg"
<grinberg-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>,
"Andrew F. Davis" <afd-l0cyMroinI0@public.gmane.org>,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
letux-kernel-S0jZdbWzriLCfDggNXIi3w@public.gmane.org,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation
Date: Fri, 30 Sep 2016 16:16:04 +0200 [thread overview]
Message-ID: <20160930141603.mlo5v75oy72j64d5@earth> (raw)
In-Reply-To: <E8C59C6C-23D4-4417-8A9E-3E9AE5D2D100-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 4909 bytes --]
Hi,
On Sat, Sep 24, 2016 at 07:55:27AM +0200, H. Nikolaus Schaller wrote:
> > So ti,max-[xy] is basically the same as touchscreen-size-[xy],
>
> No it is not the same and should be kept separate.
>
> > except, that the generic bindings don't support min-[xy] != 0.
>
> What would be the purpose of this? Every user-space I know
> about (X11, Replicant) expects coordinates in some range
> 0..max so setting min in device tree makes no sense to me.
>
> >
> > So maybe change the generic bindings like this:
> >
> > touchscreen-min-x: minimum value reported by X axis ADC (default 0)
> > touchscreen-max-x: maximum value reported by Y axis ADC
> > touchscreen-min-y: minimum value reported by Y axis ADC (default 0)
> > touchscreen-max-y: maximum value reported by Y axis ADC
> > touchscreen-size-x: deprecated alias for touchscreen-max-x
> > touchscreen-size-y: deprecated alias for touchscreen-max-y
> >
>
> Initially I had thought about this but it does not solve the problems
> with touch pre-calibration. Since it mixes raw coordinates with
> system coordinates.
touchscreen-size-x was actually refering to your definition of
touchscreen-max-x and not system coordinates. For that it would
make much more sense to use a phandle to the screen IMHO.
> To achieve the goal of having a roughly precalibrated touch which
> should provide (0,0) at the lower left corner and
> (touchscreen-size-x,touchscreen-size-y) in pixel coordinates of
> the panel. Hence it roughly works without a calibration matrix in
> user space (e.g. xorg.conf or Replicant).
well I did not mean to use touchscreen-size-x/y for describing the
size of screen, as visible in n900.dts (first implementation of the
common binding), which sets the value to 4096.
> Why do we need pre-calibration? Because some systems might need
> touch interaction before they can offer (force) the user into
> a touch calibration step. We use these drivers and approach in
> our production kernels for GTA04, OpenPandora and Pyra for a while
> and nobody was even missing a user-space calibration tool any more.
I have nothing against the feature. OTOH I'm quite in of kernel
based TS calibration. Note, that you can only add it for hardware
without pre-existing touchscreen support, since you break peoples
systems otherwise (We have that problem for N900).
> The underlaying problem is that you can have the same controller chip
> in different board designs and there are different touch panel types.
> Each one has certain physical properties but they can differ.
> But you certainly want touchscreen-size-x/y to be a constant.
>
> Now if we make touchscreen-max-x/y the same as touchscreen-size-x/y
> and change the panel, we have to adjust user space transformation
> each time we change the panel. This does not seem to be right
> and can be done better by keeping them separately.
>
> This is what this approach does: the roughly correct scaling of
> raw values to pixel values.
>
> ti,min-x -> 0
> ...
> x -> some value between 0 and touchscreen-size-x
> calculated by
> touchscreen-size-x * (x - min-x) / (max-x - min-x)
> ...
> ti,max-x -> touchscreen-size-x
>
> Hence the ti,min/max values describe the range of expected input
> values from the ADC and the touchscreen-size-x describes the touch
> in LCD pixels passed as input events.
so basically you use touchscreen-size-x to describe the screen and
not the touchscreen. When I added it, I did mean the max ADC value.
Actually I was under the impression, that X drivers would scale this
to screen size automatically. Since all my touchscreen HW required
calibration I did never test this, though.
> Example:
>
> ti,min-x = 64
> ti,max-x = 4016
> touchscreen-size-x = 480
>
> If we change the panel type which presents a slightly different ADC range:
>
> ti,min-x = 100
> ti,max-x = 3900
> touchscreen-size-x = 480
>
> and we still get a coordinate range (0 .. 480).
>
> Note that this feature can be effectively disabled if ti,min-x=0 and
> ti,max-x=4095 and touchscreen-size-x=4095, i.e. reports the full
> range of ADC values because then it multiplies by 1.
>
> Our proposed driver does use these values if they are missing from DT
> and therefore it should not break old DT files which expect raw values
> to be reported.
>
> I hope this clarifies what we need to achieve and you can
> agree.
I did understand what you want, but I disagreed about
using touchscreen-size-x/y for system coordinates. I
now see, that it's too late for that, as other people
already did so.
I do agree with Rob, that the ti,min/max-x/y should become common,
though. Also I would do s/minimum value/minimum raw value/g.
Additionally touchscreen-size-x/y should mention, that it's used to
scale the raw values.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2016-09-30 14:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 12:41 [PATCH v3 0/8] drivers: touchscreen: tsc2007 and ads7846/tsc2046 improvements (use common touchscreen bindings, pre-calibration, spi fix and provide iio raw values) H. Nikolaus Schaller
2016-09-23 12:41 ` [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation H. Nikolaus Schaller
[not found] ` <1409ed9845f17445a8a67bd6fb16c902c3e4f69c.1474634475.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-09-23 22:47 ` Rob Herring
2016-09-24 0:31 ` Sebastian Reichel
2016-09-24 5:55 ` H. Nikolaus Schaller
[not found] ` <E8C59C6C-23D4-4417-8A9E-3E9AE5D2D100-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-09-30 14:16 ` Sebastian Reichel [this message]
2016-09-30 14:40 ` H. Nikolaus Schaller
[not found] ` <29036A28-9997-4ED6-81FE-3ABC659EEEEB-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-10-17 13:57 ` H. Nikolaus Schaller
2016-09-24 5:28 ` H. Nikolaus Schaller
2016-09-30 16:23 ` [Letux-kernel] " Christ van Willegen
[not found] ` <CA+Ot1Owa_evu62LJpH+TdUkLWd0n+0Dm30Q1-5KFJ6w_UBPfQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-30 16:36 ` H. Nikolaus Schaller
2016-09-23 12:41 ` [PATCH v3 2/8] drivers:input:tsc2007: send pendown and penup only once like ads7846(+tsc2046) driver does H. Nikolaus Schaller
2016-09-23 12:41 ` [PATCH v3 4/8] drivers:input:tsc2007: check for presence and power down tsc2007 during probe H. Nikolaus Schaller
[not found] ` <cover.1474634475.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-09-23 12:41 ` [PATCH v3 3/8] drivers:input:tsc2007: add iio interface to read external ADC input, temperature and raw conversion values H. Nikolaus Schaller
[not found] ` <909d06d4f54359c7ac0dcf36a49cbd3ff7e8ebf2.1474634475.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-09-24 16:07 ` Jonathan Cameron
2016-09-24 17:07 ` H. Nikolaus Schaller
[not found] ` <8A30B517-FE25-418B-9921-407243B0B72B-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2016-09-24 17:26 ` Jonathan Cameron
2016-09-24 17:42 ` H. Nikolaus Schaller
2016-09-24 17:44 ` Dmitry Torokhov
[not found] ` <CAKdAkRS3OhUp=WXtrLxQSJAvtgt24jo2W8Nw_NwR4O=R9jboaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-24 17:51 ` H. Nikolaus Schaller
2016-09-23 12:41 ` [PATCH v3 5/8] DT:omap3+tsc2007: use new common touchscreen bindings H. Nikolaus Schaller
2016-09-23 12:41 ` [PATCH v3 6/8] drivers:input:ads7846(+tsc2046): add new common binding names, pre-calibration and flipping H. Nikolaus Schaller
2016-09-23 22:50 ` Rob Herring
2016-09-23 12:41 ` [PATCH v3 7/8] drivers:input:ads7846(+tsc2046): fix spi module table H. Nikolaus Schaller
2016-09-23 12:41 ` [PATCH v3 8/8] DT:omap3+ads7846: use new common touchscreen bindings H. Nikolaus Schaller
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=20160930141603.mlo5v75oy72j64d5@earth \
--to=sre-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=afd-l0cyMroinI0@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=grinberg-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org \
--cc=hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org \
--cc=javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
--cc=letux-kernel-S0jZdbWzriLCfDggNXIi3w@public.gmane.org \
--cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mika.penttila-MRsr7dthA9VWk0Htik3J/w@public.gmane.org \
--cc=mwelling-EkmVulN54Sk@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
/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