From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pali =?utf-8?q?Roh=C3=A1r?= Subject: Re: [PATCH v9 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Date: Mon, 20 Feb 2017 22:08:50 +0100 Message-ID: <201702202208.50498@pali> References: <201702202042.15878@pali> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1744452.UVGmpsnQfS"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201702202042.15878@pali> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "H. Nikolaus Schaller" Cc: Dmitry Torokhov , Sebastian Reichel , Mark Rutland , =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Russell King , Arnd Bergmann , Michael Welling , Mika =?utf-8?q?Penttil=C3=A4?= , Javier Martinez Canillas , Igor Grinberg , "Andrew F. Davis" , Mark Brown , Jonathan Cameron , Rob Herring , Alexander Stein , Eric Engestrom , Hans de Goede , Benjamin Tissoires List-Id: linux-input@vger.kernel.org --nextPart1744452.UVGmpsnQfS Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Monday 20 February 2017 20:42:15 Pali Roh=C3=A1r wrote: > Hi Nikolaus! >=20 > On Monday 20 February 2017 17:50:04 H. Nikolaus Schaller wrote: > > Hi Dmitry, > >=20 > > > Input driver may set resolution for given axis in units per mm > > > (or units per radian for rotational axis ABS_RX, ABS_RY, > > > ABS_RZ), and if you check the binding, you can use > > > "touchscreen-x-mm" and "touchscreen-y-mm" to specify the size of > > > entire touch surface and set resolution from it so that > > > userspace can calculate the proper scaling factor. > >=20 > > How is this information exposed by the kernel to user-space? By > > scanning the DT file or tree? >=20 > Set input_abs_set_res() from kernel. And in userspace call EVIOCGABS > ioctl() on input device. Look at struct input_absinfo, you should > have all needed information here. This is generic input interface, > no DT is needed. Looking at kernel code... via EVIOCSABS ioctl() you can even set=20 resolution from userspace for specified input device. So this could be potentially used for calibrating input device from=20 userspace? (In case DT data will not fully match current HW) > I hope that XServer is already using it for evdev devices... >=20 > For whole implementation look at evtest program. That should be good > starting point for your userspace implementation. >=20 > While I'm watching this discussion... in my opinion kernel should > just invert input axes (when needed) and should not do any other > normalization or integer/floating-point > re-calibration/re-calculation. If it correctly exports minimum > value, maximum value and resolution then userspace can correctly > re-scale input events to units which userspace needs (e.g. mapping > into LCD screen pixels or whatever is needed). =2D-=20 Pali Roh=C3=A1r pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --nextPart1744452.UVGmpsnQfS Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAlirWuIACgkQi/DJPQPkQ1LF6ACbBrF6PHJA3rBGfSzDBZ7i0gYp ugYAn16sy9AkgXOzJBfvTjJGEI0Q6AUc =dm6m -----END PGP SIGNATURE----- --nextPart1744452.UVGmpsnQfS-- -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html