diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-10-17 14:45:13 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-17 20:53:09 +0200 |
commit | cc3ece1da4f1d6b8742805770f18488183f8ad02 (patch) | |
tree | 1b6c51ad66a3d386d176521174fc53a9fb7c3be3 /src/platformsupport | |
parent | 1d3fce8b509fdb7d71f8e40ef9ed720f4dc69202 (diff) |
evdevtouch: Make it work with am335x
The driver for the resistive touchscreen of these boards tends to report
ABS limits 0..4095 even tough it never sends coordinates outside a certain
range (e.g. approximately 165..4016 for X). This breaks the mapping of
hardware coordinates to screen space. Apply a workaround to make it
work properly.
Change-Id: I3eb5d76002acba1972061f3add44d797349c8ec8
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 3b79a2ac80..89215557c1 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -300,6 +300,21 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, qDebug("evdevtouch: device name: %s", name); } + // Fix up the coordinate ranges for am335x in case the kernel driver does not have them fixed. + if (d->hw_name == QLatin1String("ti-tsc")) { + if (d->hw_range_x_min == 0 && d->hw_range_x_max == 4095) { + d->hw_range_x_min = 165; + d->hw_range_x_max = 4016; + } + if (d->hw_range_y_min == 0 && d->hw_range_y_max == 4095) { + d->hw_range_y_min = 220; + d->hw_range_y_max = 3907; + } + if (printDeviceInfo) + qDebug("evdevtouch: found ti-tsc, overriding: min X: %d max X: %d min Y: %d max Y: %d", + d->hw_range_x_min, d->hw_range_x_max, d->hw_range_y_min, d->hw_range_y_max); + } + bool grabSuccess = !ioctl(m_fd, EVIOCGRAB, (void *) 1); if (grabSuccess) ioctl(m_fd, EVIOCGRAB, (void *) 0); |