Input: of_touchscreen - add support for touchscreen-min-x|y
authorHans de Goede <hdegoede@redhat.com>
Fri, 12 Oct 2018 00:04:13 +0000 (17:04 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 12 Oct 2018 00:16:42 +0000 (17:16 -0700)
commitd9265e8a878aa19898667ab32f6b8936170cf1f9
tree8587c3cd0273261ff450bc1d21e6c29deb2f5bf2
parent291e2ba9054e96b33544d67deee252b3a370ebda
Input: of_touchscreen - add support for touchscreen-min-x|y

Some touchscreens, depending on the firmware and/or the digitizer, report
coordinates which never reach 0 along one or both of their axis.

This has been seen for example on the Silead touchscreens on a Onda V891w
and a Point of View mobii TAB-P800w(v2.0).

This commit adds support for touchscreen-min-x and touchscreen-min-y
device-properties which can be set to communicate the actual start
coordinates (rather then 0,0) to userspace.

This commit also drop the "(in pixels)" comment from the documentation
of the touchscreen-size-x and touchscreen-size-y properties. The comment
suggested that there is a relation between the range of reported
coordinates and the display resolution, which is only true for some
devices. The "(in pixels)" comment is replaced with "(maximum x coordinate
reported + 1)" to mirror the language describing the new touchscreen-min-x
and -min-y properties.

When set this fixes e.g. not being able to click things in the GNOME3
top-bar on the 2 example tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
drivers/input/touchscreen/of_touchscreen.c